/* MCI PWA App - Mobile First Design */

:root {
    --primary-color: #4285F4;
    --primary-dark: #3367D6;
    --primary-light: #5B9BF8;
    --secondary-color: #34A853;
    --accent-color: #EA4335;
    --warning-color: #FBBC04;
    --text-primary: #202124;
    --text-secondary: #5F6368;
    --background-light: #F8F9FA;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(66, 133, 244, 0.15);
    --shadow-hover: 0 4px 16px rgba(66, 133, 244, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-light);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

/* Global App Bar */
.global-app-bar {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.app-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 480px;
    margin: 0 auto;
}

.app-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-bar-back-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.app-bar-back-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.app-bar-logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 32px;
    filter: brightness(0) invert(1);
}

.app-bar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin-left: 0.5rem;
}

/* Language Switcher Button */
.app-bar-lang-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
    position: relative;
}

.app-bar-lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.app-bar-lang-btn .lang-text {
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.2rem;
}

/* RTL Support */
[dir="rtl"] .app-bar-lang-btn .lang-text {
    margin-left: 0;
    margin-right: 0.2rem;
}
}

.app-bar-right {
    display: flex;
    align-items: center;
}

.app-bar-notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
}

.app-bar-notification-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-color);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--primary-color);
}

/* Legacy Header (for backward compatibility) */
.app-header {
    background: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    height: 40px;
    width: auto;
    max-width: 200px;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-logo {
    height: 40px;
    width: auto;
    max-width: 200px;
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 2rem 1rem;
    background: var(--white);
    margin: 1rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.welcome-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.welcome-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.welcome-text {
    flex: 1;
    text-align: left;
}

.welcome-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.logout-btn i {
    font-size: 1.1rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Quick Actions */
.quick-actions {
    margin-top: 2rem;
}

.action-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--white);
    font-size: 1.5rem;
}

.action-card h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Global Bottom Navigation */
.global-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--white);
    border-top: 1px solid #e9ecef;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.bottom-nav-container {
    width: 100%;
}

.bottom-nav-row {
    display: flex;
    align-items: center;
}

.bottom-nav-col {
    flex: 1;
    text-align: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.bottom-nav-item:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Legacy Bottom Navigation (for backward compatibility) */
.bottom-nav {
    background: var(--white);
    padding: 0.75rem 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    bottom: 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 576px) {
    .app-main {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
        padding-bottom: 5rem; /* Space for global bottom nav */
    }
    
    .welcome-title {
        font-size: 1.75rem;
    }

    .welcome-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .welcome-text {
        text-align: center;
    }
    
    .action-card {
        height: 100px;
        padding: 1rem 0.5rem;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .action-card h5 {
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    .app-main {
        margin: 2rem;
        padding: 2.5rem;
    }
    
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .action-card {
        height: 140px;
    }
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    .app-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .app-header {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
    
    .global-bottom-nav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }
    
    .bottom-nav {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* New Approval Page Styles */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.page-header h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    margin: 0;
}

/* Form Styles */
.approval-form {
    max-width: 100%;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Provider Dropdown */
.dropdown-container {
    position: relative;
}

.provider-logo {
    border-radius: 4px;
    object-fit: cover;
}

.provider-option {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f5f5f5;
}

.provider-option:hover {
    background-color: #f8f9fa;
}

.provider-option:last-child {
    border-bottom: none;
}

/* Upload Areas */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(66, 133, 244, 0.05);
}

.upload-content {
    color: var(--text-secondary);
}

.upload-content i {
    margin-bottom: 1rem;
}

.upload-buttons {
    margin-top: 1rem;
}

/* Uploaded File Styles */
.uploaded-file {
    text-align: left;
}

.file-preview {
    margin-bottom: 1rem;
}

.file-preview img {
    max-height: 200px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.file-info {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Character Counter */
.form-text {
    font-size: 0.875rem;
}

#charCount {
    font-weight: 600;
}

#charCount.text-warning {
    color: var(--warning-color) !important;
}

#charCount.text-danger {
    color: var(--accent-color) !important;
}

/* Connection Status Banner */
.connection-status-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 0.75rem 1rem;
    background-color: var(--accent-color);
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideDown 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.connection-status-banner.offline {
    background-color: var(--accent-color);
}

.connection-status-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.connection-status-content i {
    font-size: 1rem;
}

/* Legacy Status Banner (kept for compatibility) */
.status-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

.status-banner.online {
    background-color: var(--secondary-color);
}

.status-banner.offline {
    background-color: var(--accent-color);
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Modal Styles */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-hover);
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* PWA Install Banner */
.pwa-install-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: none; /* Hidden by default, shown via JavaScript */
}

.pwa-install-banner.show {
    display: block;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pwa-install-text {
    flex: 1;
}

.pwa-install-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.pwa-install-description {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

.pwa-install-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pwa-install-btn {
    background: var(--white);
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pwa-install-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-1px);
}

.pwa-dismiss-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.pwa-dismiss-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments for approval page */
@media (max-width: 576px) {
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    .file-actions {
        flex-direction: column;
    }
    
    .file-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .file-actions .btn:last-child {
        margin-bottom: 0;
    }
    
    .pwa-install-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .pwa-install-actions {
        width: 100%;
        justify-content: center;
    }
}
