:root {
    --primary-color: #2196F3;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --purple-color: #9C27B0;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* Tema Escuro */
[data-theme="dark"] {
    --primary-color: #64B5F6;
    --success-color: #81C784;
    --warning-color: #FFB74D;
    --danger-color: #E57373;
    --purple-color: #BA68C8;
    --text-dark: #FFFFFF;
    --text-light: #CCCCCC;
    --bg-light: #1E1E1E;
    --white: #2D2D2D;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
}

[data-theme="dark"] body {
    background: #121212;
    color: var(--text-dark);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .setting-item select {
    background: #383838;
    color: #FFFFFF;
    border-color: #555;
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: #AAAAAA;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus,
[data-theme="dark"] .setting-item select:focus {
    border-color: var(--primary-color);
    background: #404040;
}

[data-theme="dark"] .search-bar input {
    background: #383838;
    color: #FFFFFF;
    border-color: #555;
}

[data-theme="dark"] .search-bar input::placeholder {
    color: #AAAAAA;
}

[data-theme="dark"] .search-bar input:focus {
    border-color: var(--primary-color);
    background: #404040;
}

[data-theme="dark"] .form-group label {
    color: #FFFFFF;
}

[data-theme="dark"] .section-header h2,
[data-theme="dark"] .settings-group h3,
[data-theme="dark"] .medication-form h3,
[data-theme="dark"] .emergency-contact-form h3 {
    color: #FFFFFF;
}

[data-theme="dark"] .faq-question {
    background: #383838;
    color: #FFFFFF;
}

[data-theme="dark"] .faq-question:hover {
    background: #404040;
}

[data-theme="dark"] .faq-answer {
    background: var(--white);
    color: #FFFFFF;
    border-top-color: #555;
}

[data-theme="dark"] .empty-state,
[data-theme="dark"] .empty-message {
    color: #AAAAAA;
}

[data-theme="dark"] .dose-medication,
[data-theme="dark"] .medication-dosage,
[data-theme="dark"] .contact-relation,
[data-theme="dark"] .contact-phone,
[data-theme="dark"] .pharmacy-distance,
[data-theme="dark"] .refill-status {
    color: #CCCCCC;
}

[data-theme="dark"] .medication-name,
[data-theme="dark"] .dose-time,
[data-theme="dark"] .contact-name,
[data-theme="dark"] .pharmacy-name,
[data-theme="dark"] .refill-medication {
    color: #FFFFFF;
}

[data-theme="dark"] .switch .slider {
    background-color: #555;
}

[data-theme="dark"] input:checked + .slider {
    background-color: var(--primary-color);
}

/* Ajustar logos para tema escuro */
[data-theme="dark"] .app-logo {
    filter: drop-shadow(0 2px 4px rgba(100, 181, 246, 0.4));
}

[data-theme="dark"] .app-logo:hover {
    filter: drop-shadow(0 4px 8px rgba(100, 181, 246, 0.6));
}

[data-theme="dark"] .footer-logo {
    filter: drop-shadow(0 2px 6px rgba(100, 181, 246, 0.4));
}

[data-theme="dark"] .footer-brand:hover .footer-logo {
    filter: drop-shadow(0 4px 12px rgba(100, 181, 246, 0.6));
}

/* Corrigir fundos dos cards e elementos no tema escuro */
[data-theme="dark"] .medication-card,
[data-theme="dark"] .dose-item,
[data-theme="dark"] .emergency-contact-card,
[data-theme="dark"] .pharmacy-card,
[data-theme="dark"] .refill-card,
[data-theme="dark"] .interaction-item,
[data-theme="dark"] .emergency-med-item,
[data-theme="dark"] .emergency-contact-item,
[data-theme="dark"] .medication-form,
[data-theme="dark"] .emergency-contact-form,
[data-theme="dark"] .settings-groups,
[data-theme="dark"] .welcome-card,
[data-theme="dark"] .emergency-card,
[data-theme="dark"] .emergency-info,
[data-theme="dark"] .medications-list,
[data-theme="dark"] .next-doses,
[data-theme="dark"] .interaction-checker,
[data-theme="dark"] .pharmacy-info,
[data-theme="dark"] .pharmacies-list,
[data-theme="dark"] .refill-requests {
    background: var(--white) !important;
    color: var(--text-dark);
}

[data-theme="dark"] .info-section {
    border-bottom-color: #444;
}

[data-theme="dark"] .settings-group {
    border-bottom-color: #444;
}

/* Corrigir gradients no tema escuro */
[data-theme="dark"] .welcome-card {
    background: linear-gradient(135deg, #64B5F6, #BA68C8) !important;
    color: white;
}

[data-theme="dark"] .emergency-card {
    background: linear-gradient(135deg, #E57373, #FF8A65) !important;
    color: white;
}

/* Corrigir estados especiais */
[data-theme="dark"] .status-active {
    background: #1B5E20;
    color: #81C784;
}

[data-theme="dark"] .status-low {
    background: #E65100;
    color: #FFB74D;
}

[data-theme="dark"] .status-empty {
    background: #B71C1C;
    color: #E57373;
}

[data-theme="dark"] .time-badge {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .med-dosage {
    background: #1E88E5;
    color: white;
}

/* Tema Verde Saúde */
[data-theme="green"] {
    --primary-color: #4CAF50;
    --success-color: #66BB6A;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --purple-color: #8BC34A;
    --text-dark: #1B5E20;
    --text-light: #388E3C;
    --bg-light: #E8F5E8;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(76,175,80,0.15);
}

[data-theme="green"] .app-logo,
[data-theme="green"] .footer-logo {
    filter: drop-shadow(0 2px 6px rgba(76, 175, 80, 0.4));
}

[data-theme="green"] .app-logo:hover {
    filter: drop-shadow(0 4px 8px rgba(76, 175, 80, 0.6));
}

[data-theme="green"] .footer-brand:hover .footer-logo {
    filter: drop-shadow(0 4px 12px rgba(76, 175, 80, 0.6));
}

/* Tema Roxo Elegante */
[data-theme="purple"] {
    --primary-color: #9C27B0;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #E91E63;
    --purple-color: #673AB7;
    --text-dark: #4A148C;
    --text-light: #7B1FA2;
    --bg-light: #F3E5F5;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(156,39,176,0.15);
}

[data-theme="purple"] .app-logo,
[data-theme="purple"] .footer-logo {
    filter: drop-shadow(0 2px 6px rgba(156, 39, 176, 0.4));
}

[data-theme="purple"] .app-logo:hover {
    filter: drop-shadow(0 4px 8px rgba(156, 39, 176, 0.6));
}

[data-theme="purple"] .footer-brand:hover .footer-logo {
    filter: drop-shadow(0 4px 12px rgba(156, 39, 176, 0.6));
}

/* Tema Laranja Acolhedor */
[data-theme="warm"] {
    --primary-color: #FF9800;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --purple-color: #FF5722;
    --text-dark: #E65100;
    --text-light: #F57C00;
    --bg-light: #FFF3E0;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(255,152,0,0.15);
}

[data-theme="warm"] .app-logo,
[data-theme="warm"] .footer-logo {
    filter: drop-shadow(0 2px 6px rgba(255, 152, 0, 0.4));
}

[data-theme="warm"] .app-logo:hover {
    filter: drop-shadow(0 4px 8px rgba(255, 152, 0, 0.6));
}

[data-theme="warm"] .footer-brand:hover .footer-logo {
    filter: drop-shadow(0 4px 12px rgba(255, 152, 0, 0.6));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 80px;
}

/* Garantir que sempre tenha espaço para navegação inferior */
@media (min-width: 768px) {
    body {
        padding-bottom: 90px;
    }
}

@media (min-width: 1024px) {
    body {
        padding-bottom: 100px;
    }
}

.app-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(255,255,255,0.3));
    transition: var(--transition);
}

.app-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(255,255,255,0.5));
}

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

.language-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(10px);
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.language-btn:active {
    transform: translateY(0);
}

.language-text {
    font-weight: 600;
    font-size: 0.8rem;
}

.emergency-btn,
.emergency-section-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.emergency-section-btn {
    background: var(--warning-color);
    color: var(--text-dark);
}

.emergency-btn:hover,
.emergency-section-btn:hover {
    background: #d32f2f;
    color: white;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .app-header h1 {
        font-size: 1.1rem;
    }
    
    .app-logo {
        width: 36px;
        height: 36px;
    }
    
    .welcome-logo {
        width: 56px;
        height: 56px;
    }
    
    .header-actions {
        flex-direction: row;
        gap: 0.8rem;
        justify-content: center;
    }
    
    .language-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }
    
    .footer-logo {
        width: 28px;
        height: 28px;
    }
    
    .header-actions {
        flex-direction: row;
        gap: 0.8rem;
        justify-content: center;
    }
    
    .emergency-btn,
    .emergency-section-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        flex: 1;
        max-width: 150px;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        gap: 0.6rem;
    }
    
    .emergency-btn,
    .emergency-section-btn {
        width: 100%;
        max-width: none;
    }
}

.app-main {
    padding: 1rem;
    max-width: 100%;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

.welcome-card {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.welcome-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.welcome-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 4px 12px rgba(255,255,255,0.4));
    transition: var(--transition);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(0) invert(1) drop-shadow(0 4px 12px rgba(255,255,255,0.4));
    }
    50% {
        transform: scale(1.05);
        filter: brightness(0) invert(1) drop-shadow(0 6px 16px rgba(255,255,255,0.6));
    }
}

.welcome-card h2 {
    font-size: 1.5rem;
    margin: 0;
}

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

.action-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.medications-list {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 2rem 1rem;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.medication-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.medication-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.medication-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.medication-dosage {
    color: var(--text-light);
    font-size: 0.9rem;
}

.medication-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-edit {
    background: var(--warning-color);
    color: white;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-take {
    background: var(--success-color);
    color: white;
}

.next-doses {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.next-doses h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.dose-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.dose-time {
    font-weight: 600;
    color: var(--primary-color);
}

.dose-medication {
    font-size: 0.9rem;
    color: var(--text-light);
}

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

.section-header h2 {
    color: var(--text-dark);
    font-size: 1.3rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt-buttons {
    display: flex;
    gap: 0.75rem; /* espaço horizontal entre botões */
}

.btn-primary,
.btn-secondary {
    flex: 1; /* opcional: ambos ocupam metade do espaço */
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
   
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
  
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: #d32f2f;
}

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

.search-bar {
    margin-bottom: 1.5rem;
}

.search-bar input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.medications-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.medication-form {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.medication-form h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.interaction-checker {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.checker-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #856404;
}

.interaction-results {
    margin-top: 1.5rem;
}

.interaction-item {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.interaction-severity {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.interaction-severity.high {
    color: var(--danger-color);
}

.interaction-severity.medium {
    color: var(--warning-color);
}

.interaction-severity.low {
    color: var(--success-color);
}

.pharmacy-info {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    text-align: center;
}

.pharmacy-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.pharmacies-list,
.refill-requests {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.pharmacy-card,
.refill-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.pharmacy-name,
.refill-medication {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pharmacy-distance,
.refill-status {
    color: var(--text-light);
    font-size: 0.9rem;
}

.pharmacies-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.location-info {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.source-info {
    color: var(--warning-color);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    font-style: italic;
}

.pharmacy-website a {
    color: var(--primary-color);
    text-decoration: none;
}

.pharmacy-website a:hover {
    text-decoration: underline;
}

.pharmacy-source {
    color: var(--text-light);
    font-size: 0.8rem;
    font-style: italic;
}

.pharmacy-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.pharmacy-actions .btn-small {
    flex: 1;
    min-width: 120px;
}

.status-message {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-top: 0.3rem;
    font-weight: 500;
}

.pharmacy-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.8rem;
    background: var(--bg-light);
    border-radius: 8px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 0.85rem;
    color: var(--text-dark);
    background: var(--white);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pharmacy-stats {
        gap: 0.5rem;
    }
    
    .stat-item {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Modal de Reabastecimento */
.refill-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.refill-modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.refill-modal h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.selected-pharmacy {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.selected-pharmacy strong {
    color: var(--text-dark);
}

.refill-modal .form-group {
    margin-bottom: 1rem;
}

.refill-modal .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.refill-modal .form-actions button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.refill-modal .btn-primary {
    background: var(--primary-color);
    color: white;
}

.refill-modal .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.refill-modal .btn-secondary {
    background: var(--text-light);
    color: var(--text-dark);
}

.refill-modal .btn-secondary:hover {
    background: var(--danger-color);
    color: white;
}

@media (max-width: 480px) {
    .refill-modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .refill-modal .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .refill-modal .form-actions button {
        width: 100%;
    }
}

.emergency-card {
    background: linear-gradient(135deg, var(--danger-color), #ff5722);
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.emergency-info {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.info-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-section h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.allergies-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.emergency-contact-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.contact-relation,
.contact-phone {
    color: var(--text-light);
    font-size: 0.9rem;
}

.emergency-contact-form {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

.settings-groups {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.settings-group {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.settings-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-group h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-item select {
    min-width: 200px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--text-dark);
}

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

.data-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.data-buttons .btn-secondary {
    flex: 1; /* Ambos ocupam o mesmo espaço */
}

.danger-zone {
    margin-top: 1rem;
    text-align: center;
}

.btn-danger {
    background: #e53935;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #c62828;
}


.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: #ccc;
    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(--primary-color);
}

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

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

.faq-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* FAQ dentro do settings-group */
.settings-group .faq-container {
    margin-top: 1rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

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

.faq-question:hover {
    background: #e8e8e8;
}

.faq-question[aria-expanded="true"] {
    background: var(--primary-color);
    color: white;
}

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

.faq-icon {
    font-size: 1.2rem;
    transition: var(--transition);
}

.faq-answer {
    padding: 1rem;
    background: white;
    border-top: 1px solid #ddd;
    animation: slideDown 0.3s ease;
}

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

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

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    min-width: 60px;
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-light);
    font-size: 0.85rem;
    background: var(--white);
    margin-top: 2rem;
    border-top: 2px solid var(--primary-color);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--primary-color);
    opacity: 0.6;
}

footer .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

footer .footer-brand {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(33, 150, 243, 0.3));
    transition: var(--transition);
}

.footer-brand:hover .footer-logo {
    transform: scale(1.15);
    filter: drop-shadow(0 4px 12px rgba(33, 150, 243, 0.5));
}

footer .footer-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

footer .footer-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

footer .footer-year {
    font-size: 0.8rem;
    opacity: 0.7;
}

@media (min-width: 768px) {
    footer .footer-content {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
    
    footer .footer-content::before {
        content: "•";
        color: var(--text-light);
    }
    
    footer .footer-content .footer-year::before {
        content: "•";
        margin-right: 0.5rem;
        color: var(--text-light);
    }
}

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

.modal-content {
    background-color: white;
    margin: 50% auto;
    padding: 2rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    transform: translateY(-50%);
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}

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

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.notification-permission {
    background: #e69494;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #e8f5e8;
    color: var(--success-color);
}

.status-low {
    background: #fff3e0;
    color: var(--warning-color);
}

.status-empty {
    background: #ffebee;
    color: var(--danger-color);
}

@media (min-width: 768px) {
    .app-main {
        max-width: 800px;
        padding: 2rem;
    }
    
    .quick-actions {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .pharmacy-actions {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .medications-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .form-actions {
        justify-content: flex-start;
    }
    
    .modal-content {
        margin: 20% auto;
        transform: none;
    }
}

/* Melhorias para telas maiores mantendo navegação no bottom */
@media (min-width: 768px) {
    .bottom-nav {
        padding: 0.8rem 0;
    }
    
    .nav-item {
        padding: 0.8rem;
        min-width: 80px;
    }
    
    .nav-item i {
        font-size: 1.3rem;
    }
    
    .nav-item span {
        font-size: 0.8rem;
    }
}

@media (min-width: 1024px) {
    .bottom-nav {
        padding: 1rem 0;
        justify-content: center;
        gap: 2rem;
    }
    
    .nav-item {
        flex-direction: row;
        gap: 0.8rem;
        padding: 1rem 1.5rem;
        min-width: auto;
        border-radius: var(--radius);
    }
    
    .nav-item i {
        font-size: 1.2rem;
        margin-bottom: 0;
    }
    
    .nav-item span {
        font-size: 1rem;
    }
}

.medication-times {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.time-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.stock-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.low-stock {
    color: var(--warning-color);
    font-weight: 600;
}

.out-of-stock {
    color: var(--danger-color);
    font-weight: 600;
}

.interaction-warning {
    background: #ffebee;
    border-left: 4px solid var(--danger-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.interaction-warning h4 {
    color: var(--danger-color);
    margin-bottom: 0.5rem;
}

.no-interactions {
    background: #e8f5e8;
    border-left: 4px solid var(--success-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    color: var(--success-color);
}
