/* Calendar Plan Page Styles - Table Format */

/* Hero Section */
.calendar-hero {
    padding: 160px 0 100px;
    background: linear-gradient(135deg, var(--bg-primary, #0a1628) 0%, var(--bg-secondary, #1a2a44) 50%, var(--bg-primary, #0a1628) 100%);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.calendar-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(64, 196, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(33, 150, 243, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.02)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-badge {
    display: inline-block;
    padding: 8px 24px;
    background: rgba(64, 196, 255, 0.15);
    border: 1px solid rgba(64, 196, 255, 0.3);
    border-radius: 50px;
    color: #40c4ff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary, #ffffff);
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.8));
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Filter Section */
.filter-section {
    padding: 40px 0;
    background: var(--bg-primary, #0d1b2a);
    position: sticky;
    top: 70px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Remove sticky on mobile */
@media (max-width: 768px) {
    .filter-section {
        position: relative;
        top: 0;
    }
}

.filter-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.filter-btn {
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(64, 196, 255, 0.3);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(64, 196, 255, 0.2) 0%, rgba(33, 150, 243, 0.1) 100%);
    border-color: rgba(64, 196, 255, 0.5);
    color: #40c4ff;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.25);
}

/* Calendar Section */
.calendar-section {
    padding: 60px 0 100px;
    background: var(--bg-primary, #0d1b2a);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Table Styles */
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.calendar-table thead {
    background: linear-gradient(135deg, rgba(64, 196, 255, 0.15) 0%, rgba(33, 150, 243, 0.1) 100%);
    border-bottom: 2px solid rgba(64, 196, 255, 0.3);
}

.calendar-table th {
    padding: 18px 16px;
    text-align: left;
    font-weight: 700;
    color: #40c4ff;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.calendar-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.calendar-table tbody tr:hover {
    background: rgba(64, 196, 255, 0.05);
}

.calendar-table td {
    padding: 16px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.8));
    vertical-align: middle;
}

.calendar-table td:first-child {
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    width: 60px;
}

.event-name {
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Championship - Gold */
.badge.championship {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

/* Competition - Cyan */
.badge.competition {
    background: linear-gradient(135deg, rgba(64, 196, 255, 0.2) 0%, rgba(33, 150, 243, 0.1) 100%);
    border: 1px solid rgba(64, 196, 255, 0.4);
    color: #40c4ff;
}

/* Training - Blue */
.badge.training {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(25, 118, 210, 0.1) 100%);
    border: 1px solid rgba(33, 150, 243, 0.4);
    color: #2196f3;
}

/* Seminar - Light Cyan */
.badge.seminar {
    background: linear-gradient(135deg, rgba(64, 196, 255, 0.15) 0%, rgba(33, 150, 243, 0.08) 100%);
    border: 1px solid rgba(64, 196, 255, 0.3);
    color: #40c4ff;
}

/* Festival - Gold variant */
.badge.festival {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 193, 7, 0.08) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

/* Hidden State for Filtering */
.event-row.hidden {
    display: none;
}

/* Responsive Design - Mobile Cards */
@media (max-width: 992px) {
    .calendar-hero {
        padding: 120px 0 60px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .filter-section {
        padding: 20px 0;
        top: 60px;
    }

    .filter-controls {
        gap: 8px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .calendar-section {
        padding: 40px 0 60px;
    }

    .table-wrapper {
        border: none;
        background: transparent;
        border-radius: 0;
    }

    /* Convert table to cards on mobile */
    .calendar-table thead {
        display: none;
    }

    .calendar-table,
    .calendar-table tbody,
    .calendar-table tr,
    .calendar-table td {
        display: block;
        width: 100%;
    }

    .calendar-table tr {
        margin-bottom: 20px;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        padding: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .calendar-table tr:hover {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(64, 196, 255, 0.3);
    }

    .calendar-table td {
        padding: 8px 0;
        text-align: left;
        border: none;
        position: relative;
        padding-left: 45%;
    }

    .calendar-table td:first-child {
        position: absolute;
        top: 16px;
        right: 16px;
        width: auto;
        padding: 4px 12px;
        background: rgba(64, 196, 255, 0.1);
        border: 1px solid rgba(64, 196, 255, 0.3);
        border-radius: 8px;
        color: #40c4ff;
        font-size: 0.85rem;
    }

    .calendar-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 40%;
        padding-right: 10px;
        font-weight: 700;
        color: var(--text-primary, #ffffff);
        font-size: 0.85rem;
    }

    .calendar-table td:first-child::before {
        content: none;
    }

    .event-name {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
}

@media (max-width: 500px) {
    .calendar-hero {
        padding: 100px 16px 30px;
    }

    .hero-title {
        font-size: 1.6rem;
        line-height: 1.25;
        margin-bottom: 12px;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        padding: 0 8px;
        line-height: 1.5;
    }

    .hero-badge {
        font-size: 0.65rem;
        padding: 5px 14px;
        margin-bottom: 16px;
    }

    .filter-section {
        padding: 20px 0;
        position: relative;
        top: 0;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 0 16px;
    }

    .filter-btn {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .calendar-section {
        padding: 24px 12px 40px;
    }

    /* Completely redesigned card layout */
    .calendar-table tr {
        margin-bottom: 14px;
        padding: 18px 14px;
        border-radius: 10px;
        position: relative;
    }

    .calendar-table td {
        padding: 0;
        padding-left: 0 !important;
        margin-bottom: 10px;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    /* Event number badge - top right */
    .calendar-table td:first-child {
        position: absolute;
        top: 10px;
        right: 10px;
        margin-bottom: 0;
        padding: 3px 9px;
        font-size: 0.75rem;
    }

    /* Labels before content */
    .calendar-table td::before {
        position: relative;
        display: block;
        width: 100%;
        margin-bottom: 3px;
        padding-right: 0;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        opacity: 0.65;
        font-weight: 600;
    }

    /* Date field */
    .calendar-table td:nth-child(2) {
        margin-top: 4px;
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* Event name - larger and prominent */
    .calendar-table td:nth-child(3) {
        margin-top: 10px;
        margin-bottom: 14px;
    }

    .event-name {
        font-size: 1.1rem;
        line-height: 1.35;
        margin-bottom: 0;
        font-weight: 700;
    }

    /* Type badge */
    .calendar-table td:nth-child(4) {
        margin-bottom: 14px;
    }

    /* Badge styling */
    .badge {
        align-self: flex-start;
        font-size: 0.65rem;
        padding: 4px 9px;
        border-radius: 6px;
    }

    /* Better spacing for location and participants */
    .calendar-table td:nth-child(5),
    .calendar-table td:nth-child(6) {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    /* Last item - no bottom margin */
    .calendar-table td:last-child {
        margin-bottom: 0;
    }

    /* Collapsible card functionality for mobile */
    .calendar-table tr {
        cursor: pointer;
        user-select: none;
    }

    /* Hide details by default on mobile */
    .calendar-table td:nth-child(5),
    .calendar-table td:nth-child(6) {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        margin-bottom: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Show details when expanded */
    .calendar-table tr.expanded td:nth-child(5),
    .calendar-table tr.expanded td:nth-child(6) {
        max-height: 100px;
        opacity: 1;
        margin-bottom: 10px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Add expand indicator */
    .calendar-table tr::after {
        content: '▼';
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.7rem;
        color: rgba(64, 196, 255, 0.6);
        transition: transform 0.3s ease;
    }

    .calendar-table tr.expanded::after {
        transform: translateX(-50%) rotate(180deg);
    }
}

/* Dark/Light Theme Support */
[data-theme="light"] .calendar-hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f5f7fa 100%);
}

[data-theme="light"] .hero-title {
    color: #1a2a44;
}

[data-theme="light"] .hero-subtitle {
    color: rgba(26, 42, 68, 0.8);
}

[data-theme="light"] .filter-section {
    background: #ffffff;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .filter-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(26, 42, 68, 0.7);
}

[data-theme="light"] .filter-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .filter-btn.active {
    color: #2196f3;
}

[data-theme="light"] .calendar-section {
    background: #f5f7fa;
}

[data-theme="light"] .table-wrapper {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .calendar-table thead {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(33, 150, 243, 0.05) 100%);
    border-bottom-color: rgba(33, 150, 243, 0.2);
}

[data-theme="light"] .calendar-table th {
    color: #2196f3;
}

[data-theme="light"] .calendar-table tbody tr {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .calendar-table tbody tr:hover {
    background: rgba(33, 150, 243, 0.03);
}

[data-theme="light"] .calendar-table td {
    color: rgba(26, 42, 68, 0.8);
}

[data-theme="light"] .calendar-table td:first-child,
[data-theme="light"] .event-name {
    color: #1a2a44;
}

@media (max-width: 992px) {
    [data-theme="light"] .calendar-table tr {
        background: #ffffff;
        border-color: rgba(0, 0, 0, 0.08);
    }

    [data-theme="light"] .calendar-table tr:hover {
        background: #ffffff;
        border-color: rgba(33, 150, 243, 0.3);
    }
}