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

/* Color Palette
   - Hunter Green (Primary): #2d5a3d
   - Dark Forest: #1a3d2a
   - Sage Green: #8B9D83
   - Burnt Orange (Accent): #C87941
   - Cream: #FAF8F3
   - Light Gray: #E8E8E8
*/

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #8B9D83;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(45, 90, 61, 0.3);
    padding: 40px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #2d5a3d;
}

header h1 {
    font-size: 2.5rem;
    color: #1a3d2a;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
}

/* Google Calendar Connection */
.google-calendar-section {
    margin-top: 20px;
    padding: 15px;
    background: #2d5a3d;
    border-radius: 10px;
    color: white;
}

.google-connected, .google-disconnected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.google-status {
    font-size: 1.1rem;
    font-weight: bold;
}

.connect-button, .sync-button {
    background: white;
    color: #2d5a3d;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.connect-button:hover, .sync-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.disconnect-link {
    color: white;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
}

.disconnect-link:hover {
    opacity: 0.8;
}

/* Calendar Selection Section */
.calendar-selection-section {
    margin-top: 20px;
    padding: 20px 25px;
    background: white;
    border-radius: 12px;
    border: 2px solid #2d5a3d;
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
}

.calendar-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-selection-header h3 {
    color: #1a3d2a;
    margin: 0;
    font-size: 1.1rem;
}

.close-calendar-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-calendar-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.calendar-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.calendar-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.calendar-item:hover {
    background: #e9ecef;
}

.calendar-checkbox {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.calendar-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.calendar-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.calendar-name {
    font-weight: 500;
    color: #333;
}

.primary-badge {
    background: #C87941;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.calendar-selection-actions {
    display: flex;
    justify-content: center;
}

.sync-calendars-btn {
    background: #2d5a3d;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(45, 90, 61, 0.3);
}

.sync-calendars-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.4);
    background: #1a3d2a;
}

.sync-calendars-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading-calendars {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* Date Filter Section */
.date-filter-section {
    margin-top: 20px;
    padding: 20px 25px;
    background: #FAF8F3;
    border-radius: 12px;
    border: 2px solid #8B9D83;
    box-shadow: 0 2px 8px rgba(45, 90, 61, 0.1);
}

.date-filter-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid #e0e5ec;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.date-input-group:hover {
    border-color: #2d5a3d;
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
    transform: translateY(-1px);
}

.date-input-group:focus-within {
    border-color: #2d5a3d;
    box-shadow: 0 0 0 4px rgba(45, 90, 61, 0.1);
}

.date-input-group label {
    color: #1a3d2a;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    user-select: none;
}

.date-input {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    min-width: 150px;
}

.date-input:focus {
    outline: none;
}

.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    filter: invert(23%) sepia(18%) saturate(1377%) hue-rotate(98deg) brightness(94%) contrast(90%);
    transition: all 0.2s ease;
}

.date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

.date-input::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.date-input::-webkit-datetime-edit-text {
    color: #999;
    padding: 0 0.3em;
}

.date-input::-webkit-datetime-edit-month-field,
.date-input::-webkit-datetime-edit-day-field,
.date-input::-webkit-datetime-edit-year-field {
    color: #333;
    font-weight: 500;
}

.filter-button, .reset-button, .export-button {
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-button {
    background: #2d5a3d;
    color: white;
}

.reset-button {
    background: white;
    color: #666;
    border: 2px solid #8B9D83;
}

.export-button {
    background: #C87941;
    color: white;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.3);
    background: #1a3d2a;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #2d5a3d;
    color: #2d5a3d;
}

.export-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 121, 65, 0.3);
    background: #B36835;
}

.filter-button:active, .reset-button:active, .export-button:active {
    transform: translateY(0);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: #2d5a3d;
    border-radius: 15px;
    padding: 25px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(45, 90, 61, 0.3);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(45, 90, 61, 0.5);
    background: #1a3d2a;
}

.card-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.card-content h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.card-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Charts Section */
.charts-section {
    margin-bottom: 40px;
}

.chart-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-container h2 {
    color: #1a3d2a;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.chart-wrapper {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    padding: 10px;
}

.chart-wrapper img {
    max-width: 100%;
    height: auto;
    display: none;
}

.chart-wrapper img.loaded {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.loading {
    color: #999;
    font-size: 1.1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Statistics Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-box {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-box h3 {
    color: #1a3d2a;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid #2d5a3d;
    padding-bottom: 10px;
}

.stat-box ul {
    list-style: none;
}

.stat-box li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.stat-box li:last-child {
    border-bottom: none;
}

.stat-box strong {
    color: #333;
}

/* Upload Section */
.upload-section {
    background: #8B9D83;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
    text-align: center;
}

.upload-section h2 {
    margin-bottom: 10px;
}

.upload-section p {
    margin-bottom: 20px;
    opacity: 0.95;
}

.upload-form {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#file-input {
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid white;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 1rem;
}

#file-input::file-selector-button {
    background: white;
    color: #2d5a3d;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
}

#upload-btn {
    background: white;
    color: #2d5a3d;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#upload-btn:active {
    transform: translateY(0);
}

#upload-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    min-height: 20px;
}

#upload-message.success {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

#upload-message.error {
    background: rgba(255, 0, 0, 0.3);
    color: white;
}

/* Attendee Table Section */
.attendee-table-section {
    margin-bottom: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.attendee-table-section h2 {
    color: #1a3d2a;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.attendee-table-section p {
    color: #666;
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.attendee-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.attendee-table thead {
    background: #2d5a3d;
    color: white;
}

.attendee-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attendee-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.attendee-table tbody tr:hover {
    background-color: #f5f7ff;
}

.attendee-table tbody tr:last-child {
    border-bottom: none;
}

.attendee-table td {
    padding: 12px;
    font-size: 0.9rem;
}

.name-cell {
    font-weight: bold;
    color: #333;
}

.email-cell {
    color: #666;
    font-size: 0.85rem;
}

.number-cell {
    text-align: center;
    font-weight: 600;
}

.number-cell.accepted {
    color: #4caf50;
}

.number-cell.declined {
    color: #f44336;
}

.number-cell.tentative {
    color: #ff9800;
}

.time-cell {
    text-align: right;
    font-weight: 600;
    color: #667eea;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .summary-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .card {
        padding: 15px;
    }

    .card-icon {
        font-size: 2rem;
    }

    .card-content h3 {
        font-size: 1.5rem;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .upload-form {
        flex-direction: column;
    }
}
