/* Reset en basis styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: relative;
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    min-height: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #ff8c00;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Search section */
.search-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* Accountmanagers section */
.accountants-section {
    margin-top: 25px;
}

.accountants-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accountant-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.accountant-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.accountant-btn:hover {
    background: linear-gradient(135deg, #ff8c00 0%, #4a5568 100%);
    border-color: #ff8c00;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.3);
    color: white;
}

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

.accountant-btn i {
    font-size: 2rem;
    color: #ff8c00;
    transition: all 0.3s ease;
}

.accountant-btn:hover i {
    color: white;
    transform: scale(1.1);
}

.accountant-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    transition: all 0.3s ease;
}

.accountant-btn:hover .accountant-name {
    color: white;
}

.accountant-subtitle {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
}

.accountant-btn:hover .accountant-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.accountant-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.accountant-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ff8c00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

.accountant-btn.selected {
    background: linear-gradient(135deg, #ff8c00 0%, #4a5568 100%);
    border-color: #ff8c00;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.3);
}

.accountant-btn.selected i {
    color: white;
    transform: scale(1.1);
}

.accountant-btn.selected .accountant-name {
    color: white;
}

.accountant-btn.selected .accountant-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.location-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.form-group label i {
    color: #ff8c00;
    width: 16px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-group input:focus {
    outline: none;
    border-color: #ff8c00;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.search-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #ff8c00 0%, #4a5568 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.3);
}

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

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e1e5e9;
    border-top: 4px solid #ff8c00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 5px;
}

.loading small {
    color: #888;
    font-size: 0.9rem;
}

/* Error message */
.error-message {
    background: #fee;
    color: #c53030;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #c53030;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Results */
.results {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f4f8;
}

.results-header h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.results-header h2 i {
    color: #ffd700;
}

.client-info {
    color: #666;
    font-size: 0.95rem;
}

/* Summary stats */
.summary-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Calendar tabs */
.calendar-tabs {
    margin-bottom: 30px;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 20px;
    overflow-x: auto;
    gap: 0;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: fit-content;
}

.tab-button:hover {
    color: #ff8c00;
    background: rgba(255, 140, 0, 0.05);
}

.tab-button.active {
    color: #ff8c00;
    border-bottom-color: #ff8c00;
    background: rgba(255, 140, 0, 0.1);
}

.tab-badge {
    background: #ff8c00;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.tab-button.active .tab-badge {
    background: white;
    color: #ff8c00;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff8c00;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Days list */
.days-list {
    display: grid;
    gap: 20px;
}

.day-card {
    background: #fafbfc;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.day-card:hover {
    border-color: #ff8c00;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.1);
}

.day-card.rank-1 {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5cc 100%);
    border-color: #ffd700;
}

.day-card.rank-2 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #c0c0c0;
}

.day-card.rank-3 {
    background: linear-gradient(135deg, #fff2e6 0%, #ffe5cc 100%);
    border-color: #cd7f32;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.day-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.day-title h3 {
    font-size: 1.3rem;
    color: #333;
    margin: 0;
}

.day-name {
    background: #ff8c00;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.rank-badge {
    background: linear-gradient(135deg, #ff8c00 0%, #4a5568 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e5e5e5 100%);
    color: #333;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    color: white;
}

.day-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.detail-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.detail-section h4 {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section h4 i {
    color: #ff8c00;
    width: 14px;
}

.detail-value {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.detail-secondary {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

.time-slot {
    background: #e8f4f8;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
}

.distance-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.distance-badge {
    background: #ff8c00;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.duration-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Appointments list */
.appointments-section {
    grid-column: 1 / -1; /* Span full width */
}

.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.appointment-item {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.3s ease;
}

.appointment-item:hover {
    background: #e9ecef;
    border-color: #ff8c00;
}

.appointment-time {
    font-size: 0.85rem;
    color: #ff8c00;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', monospace;
}

.appointment-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 4px 0;
}

.appointment-location {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.appointment-distance {
    background: #ff8c00;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    flex-shrink: 0;
}

/* Legend */
.legend {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.legend h3 {
    font-size: 1rem;
    color: #555;
    margin-bottom: 15px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
}

.legend-item i {
    width: 16px;
    color: #ff8c00;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .search-section,
    .results {
        padding: 20px;
    }
    
    .accountant-buttons {
        grid-template-columns: 1fr;
    }
    
    .accountant-btn {
        padding: 15px;
    }
    
    .accountant-btn i {
        font-size: 1.5rem;
    }
    
    .summary-stats {
        gap: 20px;
    }
    
    .day-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .day-details {
        grid-template-columns: 1fr;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .tabs-header {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Login Page Styling */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 48px;
    max-width: 440px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #ff8c00;
    border-radius: 16px;
    margin-bottom: 16px;
}

.login-icon i {
    font-size: 32px;
    color: white;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #718096;
    font-size: 14px;
}

.login-form-group {
    margin-bottom: 20px;
}

.login-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.login-label i {
    margin-right: 8px;
    color: #ff8c00;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

.login-input:focus {
    border-color: #ff8c00;
}

.login-error {
    padding: 12px 16px;
    background-color: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-error i {
    color: #c53030;
}

.login-error-text {
    color: #c53030;
    font-size: 14px;
}

.login-button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: #ff8c00;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.login-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.5);
    background: #e67e00;
}

.login-button:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.login-footer-text {
    font-size: 12px;
    color: #718096;
}

.login-footer-text i {
    margin-right: 6px;
}

/* Responsive styles */
@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .location-form {
        gap: 15px;
    }
    
    .search-btn {
        padding: 12px 20px;
    }
}
