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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Paper Texture Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

/* Color Variables */
:root {
    --primary-blue: #2196F3;
    --primary-green: #4CAF50;
    --primary-amber: #FFC107;
    --primary-red: #F44336;
    --primary-purple: #9C27B0;
    --background-light: #f8f9fa;
    --text-dark: #333;
    --text-light: #666;
    --border-light: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.season-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

#seasonEmoji {
    font-size: 1.2rem;
}

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

/* Sections */
.app-section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.app-section.active {
    display: block;
}

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

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

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

/* Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card i {
    font-size: 2rem;
    color: var(--primary-blue);
}

.stat-card h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.stat-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Seasonal Reminders */
.seasonal-reminders {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.seasonal-reminders h2 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.seasonal-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.seasonal-task {
    background: var(--background-light);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-green);
    transition: background-color 0.2s ease;
}

.seasonal-task:hover {
    background: #e8f5e8;
}

.seasonal-task h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.seasonal-task p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Recent Activities */
.recent-activities {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.recent-activities h2 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.activities-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--background-light);
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background: #e3f2fd;
}

.activity-icon {
    font-size: 1.25rem;
    color: var(--primary-blue);
    width: 24px;
    text-align: center;
}

.activity-details h4 {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.activity-details p {
    color: var(--text-light);
    font-size: 0.8rem;
}

.no-data {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 2rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: white;
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Tasks List */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.task-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

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

.task-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.task-category {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.task-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.task-due-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.task-priority {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.task-priority.high {
    background: #ffebee;
    color: var(--primary-red);
}

.task-priority.medium {
    background: #fff8e1;
    color: #f57f17;
}

.task-priority.low {
    background: #e8f5e8;
    color: var(--primary-green);
}

.task-cost {
    font-weight: bold;
    color: var(--primary-green);
}

.task-item.completed {
    opacity: 0.7;
    border-left: 4px solid var(--primary-green);
}

.task-item.overdue {
    border-left: 4px solid var(--primary-red);
}

/* Services List */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

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

.service-name {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.service-category {
    background: var(--primary-purple);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.service-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.service-phone, .service-email {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.service-phone a, .service-email a {
    color: var(--primary-blue);
    text-decoration: none;
}

.service-rating {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.service-notes {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* Emergency Services */
.emergency-services {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.emergency-services h3 {
    color: var(--primary-red);
    margin-bottom: 1rem;
}

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

.emergency-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--primary-red);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.emergency-card:hover {
    transform: translateY(-2px);
    background: #d32f2f;
}

.emergency-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.emergency-card span {
    text-align: center;
    font-size: 0.9rem;
    font-weight: bold;
}

/* History */
.budget-overview {
    margin-bottom: 2rem;
}

.budget-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

.budget-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.budget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--background-light);
    border-radius: 6px;
}

.budget-item span:first-child {
    color: var(--text-light);
}

.budget-item span:last-child {
    font-weight: bold;
    color: var(--primary-green);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

.history-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.history-date {
    color: var(--text-light);
    font-size: 0.8rem;
}

.history-cost {
    font-weight: bold;
    color: var(--primary-green);
}

.history-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.history-photos {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.history-photo {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.history-photo:hover {
    transform: scale(1.05);
}

/* History Controls */
.history-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    text-align: center;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
}

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

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

.btn-primary:hover {
    background: #1976d2;
}

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

.btn-secondary:hover {
    background: #d0d0d0;
}

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

.btn-success:hover {
    background: #388e3c;
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

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

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

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

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

.modal-header h3 {
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background: var(--border-light);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

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

/* Photo Capture */
.photo-capture {
    text-align: center;
}

.photo-preview {
    min-height: 200px;
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: var(--background-light);
}

.photo-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.photo-preview.empty::after {
    content: '📸 Nenhuma foto selecionada';
    color: var(--text-light);
    font-style: italic;
}

.photo-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

#photoInput {
    margin-bottom: 1rem;
}

#cameraVideo {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
}

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

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

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

.faq-item {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}

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

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

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

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

.faq-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.faq-answer {
    padding: 1rem 1.5rem;
    background: white;
    animation: slideDown 0.3s ease;
}

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

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

.faq-answer p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

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

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

.nav-item.active {
    color: var(--primary-blue);
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
    font-size: 0.8rem;
    background: var(--background-light);
    margin-top: 2rem;
    border-top: 1px solid var(--border-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-main {
        padding: 0.75rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .task-header,
    .service-header,
    .history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .task-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .emergency-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .budget-stats {
        gap: 0.5rem;
    }
    
    .budget-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.75rem;
    }
    
    .app-header h1 {
        font-size: 1.25rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 1rem;
    }
    
    .emergency-grid {
        grid-template-columns: 1fr;
    }
    
    .emergency-card {
        padding: 1.5rem;
    }
    
    .nav-item {
        min-width: 50px;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
}

/* Seasonal Themes */
.season-spring {
    --accent-color: var(--primary-green);
}

.season-summer {
    --accent-color: var(--primary-amber);
}

.season-autumn {
    --accent-color: #ff9800;
}

.season-winter {
    --accent-color: var(--primary-blue);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 4px rgba(0,0,0,0.3);
        --shadow-hover: 0 4px 8px rgba(0,0,0,0.4);
        --border-light: #999;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Focus indicators */
button:focus,
input:focus,
select:focus,
textarea:focus,
.nav-item:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .bottom-nav,
    .modal,
    .btn {
        display: none !important;
    }
    
    .app-section {
        display: block !important;
    }
    
    body {
        background: white;
        padding-bottom: 0;
    }
}
