/* ScribeFlow - Page Specific Styles
 * All shared styles moved to common.css
 * This file contains only styles specific to main app functionality
 */

/* =========================================
   NAVIGATION STYLES
   ========================================= */

.navbar {
    background: var(--nav-background);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.nav-container {
    width: 100%;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand-link {
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.nav-brand-link:hover {
    opacity: 0.85;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    height: 40px;
    width: 40px;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* User info badge in navigation (like Complimentary badge) */
.nav-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.nav-user-badge:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .nav-user-badge {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--text-primary);
}

[data-theme="dark"] .nav-user-badge:hover {
    background: rgba(59, 130, 246, 0.25);
}

.nav-user-text {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Small avatar in badge */
.nav-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    flex-shrink: 0;
}

.nav-avatar-small img.avatar-img-small {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-avatar-small .avatar-initials-small {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--background-color);
}

/* Sign out nav-link special styling */
.nav-link.signout-btn {
    color: var(--error-color);
}

.nav-link.signout-btn:hover {
    color: white;
    background-color: var(--error-color);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 160px;
    height: auto;
    box-sizing: border-box;
}

.theme-toggle:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: var(--background-color);
}

.theme-toggle i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-link span {
        display: none;
    }

    .theme-toggle {
        min-width: auto;
        padding: 0.5rem 0.75rem;
    }

    .theme-toggle span {
        display: none;
    }
}

/* =========================================
   MAIN CONTENT AREA
   ========================================= */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
    padding-top: 60px;
}

/* =========================================
   HERO SECTION (HOME PAGE)
   ========================================= */

.hero {
    background: var(--surface-color);
    padding: 4rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* =========================================
   CARDS (FEATURES, ACTIONS, ETC)
   ========================================= */

.card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* =========================================
   PROCESSING STATUS & PROGRESS
   ========================================= */

.processing-status {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.processing-status h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
}

/* Processing Log */
.processing-log {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.log-entry {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.log-entry.success {
    color: var(--success-color);
}

.log-entry.error {
    color: var(--error-color);
}

.log-entry.warning {
    color: var(--warning-color);
}

/* =========================================
   PROJECTS GRID LAYOUT
   ========================================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.project-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.project-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.project-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.project-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* =========================================
   EDITABLE TITLE FUNCTIONALITY
   ========================================= */

.editable-title {
    background: transparent;
    border: none;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    width: 100%;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.editable-title:focus {
    outline: none;
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 0 2px rgba(45, 90, 87, 0.1);
}

/* Language-aware filename input */
[dir="rtl"] .editable-title {
    text-align: right;
}

[dir="ltr"] .editable-title {
    text-align: left;
}

/* Unicode support */
.editable-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Noto Sans Arabic', 'Noto Sans Persian', sans-serif;
}

/* =========================================
   COST ESTIMATION & TRACKING
   ========================================= */

.cost-estimation {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cost-row:last-child {
    margin-bottom: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
}

.cost-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cost-value {
    color: var(--text-primary);
    font-weight: 500;
}

.cost-total {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* =========================================
   ADMIN PANEL STYLES
   ========================================= */

.admin-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-section {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.admin-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.setting-label {
    font-weight: 500;
    color: var(--text-primary);
}

.setting-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* =========================================
   FOOTER
   ========================================= */

.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.footer-content {
    width: 100%;
    max-width: 1400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-content p {
    margin: 0;
    text-align: left;
}

/* =========================================
   SEARCH FUNCTIONALITY
   ========================================= */

.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(45, 90, 87, 0.1);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.search-results {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* =========================================
   TRANSLATION CONTROLS
   ========================================= */

.translation-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
}

.model-select {
    min-width: 200px;
    max-width: 300px;
}

/* =========================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ========================================= */

@media (max-width: 768px) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .translation-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        justify-content: space-between;
    }

    .model-select {
        min-width: auto;
        max-width: none;
    }

    .admin-content {
        padding: 1rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .project-actions {
        flex-direction: column;
    }

    .cost-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .footer {
        position: relative;
        height: auto;
        padding: 1rem;
    }
}

/* =========================================
   PRINT STYLES
   ========================================= */

@media print {
    .navbar,
    .footer,
    .theme-toggle,
    .processing-log {
        display: none;
    }

    .main-content {
        min-height: auto;
    }

    .card,
    .project-card,
    .admin-section {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}