/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais - Paleta moderna de gradiente roxo-azul */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary-color: #06b6d4;
    --secondary-dark: #0891b2;
    --accent-color: #f59e0b;
    --accent-light: #fbbf24;
    
    /* Gradientes principais */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    --secondary-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    /* Cores de fundo */
    --bg-primary: #fafbff;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-overlay: rgba(15, 23, 42, 0.8);
    
    /* Cores de texto */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    /* Cores de status melhoradas */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #06b6d4;
    --info-light: #22d3ee;
    
    /* Neutros modernos */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Efeitos visuais */
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Variáveis para compatibilidade */
    --white: var(--bg-card);
    --light-gray: var(--gray-100);
    --gray: var(--gray-500);
    --dark-gray: var(--text-primary);
    --light-accent: var(--info);
    --lightest-accent: var(--info-light);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Glassmorphism overlay effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, rgba(99, 102, 241, 0.02) 0%, transparent 50%),
        linear-gradient(-45deg, rgba(139, 92, 246, 0.02) 0%, transparent 50%),
        linear-gradient(135deg, rgba(6, 182, 212, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}
.app-logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;   /* ajuste o tamanho conforme necessário */
    width: auto;
}

/* Header */
.app-header {
    background: var(--primary-gradient);
    color: var(--text-white);
    padding: 1.5rem 1rem;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.app-header h1 i {
    margin-right: 0.5rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language Selector in Header */
.language-selector {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-white);
    padding: 0.5rem 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    min-width: 60px;
    text-align: center;
}

.language-selector:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

.language-selector:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.language-selector option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Main Content */
.app-main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
}

.container {
    max-width: 100%;
}

/* Cards */
.welcome-card {
    background: var(--bg-card);
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.welcome-card h2 {
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.welcome-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    background: var(--bg-card);
    border: 2px solid var(--gray-200);
    padding: 1.75rem 1rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: var(--transition);
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn.primary {
    background: var(--primary-gradient);
    color: var(--text-white);
    border-color: transparent;
    box-shadow: var(--shadow);
}

.action-btn.secondary {
    background: var(--secondary-gradient);
    color: var(--text-white);
    border-color: transparent;
}

.action-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.action-btn.primary:hover,
.action-btn.secondary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.action-btn i {
    font-size: 1.5rem;
}

/* Recent Groups */
.recent-groups h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-item {
    background: var(--bg-card);
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(6, 182, 212, 0.02) 100%);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid transparent;
    border-image: var(--primary-gradient) 1;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.group-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
}

.group-item:hover {
    transform: translateX(8px) translateY(-2px);
    box-shadow: var(--shadow-lg);
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
}

.group-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.group-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.group-card {
    background: var(--bg-card);
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(6, 182, 212, 0.03) 100%);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.group-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.group-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-xl);
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(6, 182, 212, 0.06) 100%);
}

.group-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.group-card .group-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.group-card .group-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-item .value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-item .label {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Buttons */
.btn {
    background: var(--primary-gradient);
    color: var(--text-white);
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn.secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
    background: var(--gray-100);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn.danger {
    background: var(--danger-gradient);
}

.btn.danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn.primary {
    background: var(--primary-gradient);
}

.btn.full-width {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    background: var(--secondary-gradient);
    color: var(--text-white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.btn-icon:hover::before {
    opacity: 1;
}

.btn-icon:hover {
    background: var(--primary-gradient);
    transform: scale(1.15);
    box-shadow: var(--shadow-lg);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--light-gray);
    color: var(--danger);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.modal-header h3 {
    color: var(--primary-color);
    margin: 0;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-gray);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.form-actions .btn {
    flex: 1;
}

/* Calculator */
.calculator-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.calculation-result {
    background: linear-gradient(135deg, var(--lightest-accent), var(--white));
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--light-accent);
    margin-top: 1.5rem;
}

.calculation-result h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(3, 4, 94, 0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item .label {
    color: var(--gray);
}

.result-item .value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* OCR Section */
.ocr-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.ocr-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.ocr-section p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.ocr-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ocr-result {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray);
}

.extracted-text {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-family: monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid var(--light-gray);
}

.detected-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.amount-tag {
    background: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.amount-tag:hover {
    background: var(--secondary-color);
}

/* Settings */
.settings-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.setting-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.setting-item select {
    min-width: 150px;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.setting-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.setting-item select:hover {
    border-color: var(--primary-color);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray);
    transition: var(--transition);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Data Management */
.data-management {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.data-management h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.data-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Group Details */
.group-details-content {
    padding: 1.5rem;
}

.group-info {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.expenses-section,
.balances-section,
.settlements-section {
    margin-bottom: 2rem;
}

.expenses-section h4,
.balances-section h4,
.settlements-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expense-item {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--accent-color);
}

.expense-item h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.expense-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray);
    font-size: 0.9rem;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.balance-item.positive {
    border-left: 4px solid var(--success);
    background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.balance-item.negative {
    border-left: 4px solid var(--danger);
    background-image: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(220, 38, 38, 0.05) 100%);
}

.balance-amount {
    font-weight: 700;
    font-size: 1.2rem;
}

.balance-amount.positive {
    background: var(--success-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.balance-amount.negative {
    background: var(--danger-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.settlement-item {
    background: var(--lightest-accent);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    border: 1px solid var(--light-accent);
}

.settlement-text {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.settlement-amount {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 700;
}

/* FAQ Section */
.faq-section {
    background: var(--white);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 1rem;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 0;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--accent-color);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    transition: var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 0 1.5rem 0;
    color: var(--gray);
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(6, 182, 212, 0.02) 100%);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
  
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    min-width: 70px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.nav-item.active {
    color: var(--text-white);
    background: var(--primary-gradient);
    box-shadow: var(--shadow);
}

.nav-item.active::before {
    opacity: 1;
}

.nav-item:hover:not(.active) {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

/* Footer */
footer {
    background: var(--primary-gradient);
    color: var(--text-white);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
   
    
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

footer a {
    color: var(--info-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

footer a:hover {
    color: var(--text-white);
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-main {
        padding: 0.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .language-selector {
        font-size: 1rem;
        padding: 0.45rem 0.7rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .groups-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: 90vh;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .ocr-controls {
        flex-direction: column;
    }
    
    .data-actions {
        grid-template-columns: 1fr;
    }
    
    .group-card .group-stats {
        grid-template-columns: 1fr;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.2rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .language-selector {
        font-size: 1rem;
        padding: 0.4rem 0.6rem;
        min-width: 50px;
    }
    
    .welcome-card {
        padding: 1.5rem;
    }
    
    .welcome-card h2 {
        font-size: 1.3rem;
    }
    
    .action-btn {
        padding: 1rem;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
    
    .modal-content {
        margin: 0.5rem;
    }
    
    .form-group {
        padding: 0 1rem;
    }
    
    .form-actions {
        padding: 1rem;
    }
}

/* Dark Mode Support */
.dark-mode {
    /* Dark theme color variables */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-overlay: rgba(255, 255, 255, 0.1);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    
    /* Update gradient for dark mode */
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    color: var(--text-primary);
}

.dark-mode::before {
    background: 
        linear-gradient(45deg, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        linear-gradient(-45deg, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

/* Dark mode cards and elements */
.dark-mode .welcome-card,
.dark-mode .calculator-card,
.dark-mode .ocr-section,
.dark-mode .settings-card,
.dark-mode .data-management,
.dark-mode .faq-section,
.dark-mode .group-card,
.dark-mode .modal-content {
    background: var(--bg-card);
    border-color: var(--gray-300);
}

.dark-mode .group-item,
.dark-mode .expense-item,
.dark-mode .balance-item,
.dark-mode .settlement-item {
    background: var(--bg-card);
    border-color: var(--gray-300);
}

.dark-mode .bottom-nav {
    background: var(--bg-card);
    border-color: var(--gray-300);
}

.dark-mode .btn.secondary {
    background: var(--bg-card);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.dark-mode .btn.secondary:hover {
    background: var(--gray-200);
    border-color: var(--primary-color);
}

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea {
    background: var(--bg-card);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.dark-mode .form-group input:focus,
.dark-mode .form-group select:focus,
.dark-mode .form-group textarea:focus {
    border-color: var(--primary-color);
}

.dark-mode .language-selector {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.dark-mode .language-selector:hover,
.dark-mode .language-selector:focus {
    background: rgba(0, 0, 0, 0.3);
}

/* Dark mode additional elements */
.dark-mode .calculation-result {
    background: var(--bg-card);
    border-color: var(--gray-300);
}

.dark-mode .extracted-text {
    background: var(--bg-card);
    border-color: var(--gray-300);
}

.dark-mode .group-info {
    background: var(--bg-card);
}

.dark-mode .setting-item select {
    background: var(--bg-card);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.dark-mode .setting-item select:focus,
.dark-mode .setting-item select:hover {
    border-color: var(--primary-color);
}

.dark-mode .amount-tag {
    background: var(--primary-color);
    color: var(--text-white);
}

.dark-mode .amount-tag:hover {
    background: var(--secondary-color);
}

/* Automatic dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --light-gray: #2d2d2d;
        --gray: #a0a0a0;
        --dark-gray: #e0e0e0;
    }
    
    body:not(.dark-mode) {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        color: var(--dark-gray);
    }
}

/* Print Styles */
@media print {
    .bottom-nav,
    .app-header,
    .btn,
    .modal {
        display: none !important;
    }
    
    .section {
        display: block !important;
    }
    
    .app-main {
        padding: 0;
    }
    
    * {
        box-shadow: none !important;
    }
}
