:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #9333ea;
    --accent: #10b981;
    --danger: #ef4444;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header Styling */
.header {
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 3rem;
    border-radius: 24px;
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(50px);
}

.header-content {
    position: relative;
    z-index: 1;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 400;
}

.header-stats {
    position: relative;
    z-index: 1;
}

.stat-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Grid Layout */
.invasions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
}

/* Card Styling */
.invasion-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.invasion-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.invasion-header {
    margin-bottom: 1.25rem;
}

.invasion-id {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    background: #eef2ff;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.invasion-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.invasion-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--bg-main);
    padding: 1rem;
    border-radius: 12px;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
}

.badge {
    padding: 0.125rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Sections in Card */
.section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.schedules-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.schedule-item {
    background: white;
    border: 1px solid var(--border);
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.schedule-item.more {
    color: var(--primary);
    background: #eef2ff;
    border-color: transparent;
}

.monsters-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.monster-preview-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-main);
}

.monster-icon {
    font-size: 1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 6px;
}

.monster-name {
    flex: 1;
}

.monster-count {
    font-weight: 700;
    color: var(--primary);
}

.monster-preview-item.more {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
    padding-left: 2rem;
}

/* Button Styling */
.btn-details {
    margin-top: auto;
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-details:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.btn-details:active {
    transform: scale(0.98);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 4vh auto;
    padding: 2.5rem;
    width: 90%;
    max-width: 1000px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.modal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-main);
}

.modal-section {
    margin-bottom: 2.5rem;
}

.modal-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.detail-table,
.monster-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.detail-table td,
.monster-table th,
.monster-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
}

.detail-table tr:last-child td,
.monster-table tr:last-child td {
    border-bottom: none;
}

.detail-table td:first-child {
    background: var(--bg-main);
    font-weight: 600;
    width: 250px;
}

.monster-table thead {
    background: var(--bg-main);
}

.monster-table th {
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Real-time Status & Animations */
@keyframes flicker {

    0%,
    100% {
        border-color: var(--danger);
        box-shadow: 0 0 5px var(--danger);
    }

    50% {
        border-color: #ff0000;
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    }
}

.invasion-card.upcoming {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.invasion-card.near {
    border-color: var(--danger);
    animation: flicker 1.5s infinite ease-in-out;
    background: linear-gradient(to bottom, #fff, #fff5f5);
}

.near .invasion-id {
    background: var(--danger);
    color: white;
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.status-live {
    background: #ef4444;
    color: white;
}

.status-near {
    background: #f59e0b;
    color: white;
}

.status-wait {
    background: #64748b;
    color: white;
}

.next-time {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 700;
    margin-top: 0.5rem;
    display: block;
}

/* Rest of the existing CSS... */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        padding: 2rem;
        border-radius: 16px;
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .title {
        font-size: 1.75rem;
        justify-content: center;
    }

    .invasions-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
        margin: 2vh auto;
    }

    .detail-table td:first-child {
        width: 120px;
    }
}