/* Global Styles */
:root {
    --primary-color: #0891B2;
    --primary-hover: #0E7490;
    --primary-light: #67E8F9;
    --secondary-color: #F0F9FF;
    --accent-color: #10B981;
    --accent-sage: #6B7280;
    --accent-coral: #FB7185;
    --accent-amber: #FBBF24;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --bg-color: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-soft: #F8FAFC;
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 50%, #F0FDF4 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.input-group {
    margin-bottom: 1.75rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    font-family: var(--font-family);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: rgba(255, 255, 255, 1);
}

.input-group input:hover {
    border-color: var(--primary-color);
}

/* Login Page */
.login-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, #0891B2 0%, #0E7490 50%, #10B981 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/login_bg.png') center/cover;
    opacity: 0.1;
    z-index: 0;
}

.login-visual {
    flex: 1.2;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.login-visual::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, -30px) rotate(180deg); }
}

.login-form-wrapper {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    z-index: 2;
}

.login-form {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.login-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.login-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.forgot-password {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Index Page */
.index-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeIn 0.8s ease-out;
}

.index-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.index-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 500;
}

.page-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.page-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.page-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    text-align: center;
    border: 1px solid rgba(8, 145, 178, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.page-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.page-card:hover::before {
    transform: scaleX(1);
}

.page-card:nth-child(1) { animation-delay: 0.1s; }
.page-card:nth-child(2) { animation-delay: 0.2s; }
.page-card:nth-child(3) { animation-delay: 0.3s; }

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

.page-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    background: rgba(255, 255, 255, 1);
}

.page-card h2 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.page-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1rem;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: var(--secondary-color);
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.sidebar-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
    transition: height 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

.sidebar-nav a.active::before {
    height: 70%;
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: inline-block;
}

.sidebar-footer a:hover {
    color: var(--accent-coral);
    background: rgba(251, 113, 133, 0.1);
}

.main-content {
    flex: 1;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    padding: 2.5rem;
    overflow-y: auto;
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(8, 145, 178, 0.1), transparent);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-profile {
    position: relative;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInScale 0.6s ease-out;
    animation-fill-mode: both;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleY(1);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 1);
}

.stat-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-card:nth-child(2) .stat-value {
    background: linear-gradient(135deg, var(--accent-color) 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card:nth-child(3) .stat-value {
    background: linear-gradient(135deg, var(--accent-amber) 0%, #F59E0B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card:nth-child(4) .stat-value {
    background: linear-gradient(135deg, var(--accent-coral) 0%, #FB7185 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tables */
.recent-activity {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out 0.5s;
    animation-fill-mode: both;
}

.recent-activity h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.activity-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

.activity-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border-color);
    background: rgba(249, 250, 251, 0.5);
}

.activity-table td {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
}

.activity-table tr {
    transition: var(--transition);
}

.activity-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.02);
    transform: scale(1.01);
}

.activity-table tbody tr:hover td {
    border-bottom-color: var(--primary-color);
}

.status-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.status-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.status-tag:hover::before {
    left: 100%;
}

.status-tag.success {
    background: linear-gradient(135deg, var(--accent-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.status-tag.pending {
    background: linear-gradient(135deg, var(--accent-amber) 0%, #F59E0B 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

/* Competition List */
.competition-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fff;
}

.competition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.comp-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.comp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
}

.comp-image {
    height: 160px;
    background-color: #eee;
    /* Placeholder for actual images */
}

.comp-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.comp-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.8rem;
    color: #666;
    background-color: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.comp-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.comp-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.comp-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

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

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .login-container {
        flex-direction: column;
    }

    .login-visual {
        height: 200px;
        flex: none;
    }

    .login-form-wrapper {
        padding: 1rem;
    }

    .page-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .activity-table {
        font-size: 0.875rem;
    }

    .activity-table th,
    .activity-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .index-header h1 {
        font-size: 2.5rem;
    }

    .page-card {
        padding: 1.5rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
}

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

/* Pulse Animation for Notifications */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--accent-color));
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}