:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #0284c7;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Blobs */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4338ca;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #0ea5e9;
    bottom: -50px;
    right: -50px;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 100px) scale(1.2); }
}

/* Glassmorphism Classes */
.glass-header {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-weight: 800;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.icon-pulse {
    color: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Main Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.hidden {
    display: none !important;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

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

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out forwards;
}

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

.right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Glass Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

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

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.scorers-table {
    width: 100%;
    border-collapse: collapse;
}

.scorers-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.scorers-table td {
    padding: 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scorers-table tr:last-child td {
    border-bottom: none;
}

.scorers-table tbody tr {
    transition: background-color 0.2s;
}

.scorers-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.rank-col {
    color: var(--text-muted);
    font-weight: 600;
}

.player-name {
    font-weight: 600;
    color: var(--text-main);
}

.team-name {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.goals-col {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.1rem;
}

/* News List */
.news-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 400;
    line-height: 1.4;
    display: block;
    transition: color 0.2s;
}

.news-link:hover {
    color: var(--accent);
}

.news-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Insights */
.insight-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent);
}

.insight-card:last-child {
    margin-bottom: 0;
}

.insight-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.insight-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ec4899; /* Insta pink vibe */
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.25rem;
}

.icon-btn:hover {
    color: var(--text-main);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insta-layout {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

@media (min-width: 600px) {
    .insta-layout {
        flex-direction: row;
    }
}

.caricature-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    min-height: 200px;
}

#insta-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.insta-text-container {
    flex: 1.5;
    display: flex;
}

#insta-text {
    width: 100%;
    height: 300px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
}

.primary-btn {
    background: linear-gradient(45deg, #ec4899, #8b5cf6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s, opacity 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.generate-btn {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    transition: all 0.2s;
}

.generate-btn:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: rgba(236, 72, 153, 0.5);
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
