/* Custom Premium Styling for The Eagle Academy */
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap");

:root {
    --bg-main: #14171a;
    --bg-card: #1e2227;
    --primary-red: #d32f2f;
    --primary-red-hover: #b71c1c;
    --primary-red-glow: rgba(211, 47, 47, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #9ea4a8;
    --border-color: rgba(255, 255, 255, 0.08);
    --input-bg: #111316;
    --glass-bg: rgba(30, 34, 39, 0.75);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

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

@keyframes pulse-border {
    0% {
        border-color: var(--border-color);
        box-shadow: 0 0 0 transparent;
    }
    50% {
        border-color: var(--primary-red);
        box-shadow: 0 0 15px var(--primary-red-glow);
    }
    100% {
        border-color: var(--border-color);
        box-shadow: 0 0 0 transparent;
    }
}

/* Form Elements */
input,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
    font-size: 15px;
}

input:focus,
select:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px var(--primary-red-glow);
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

button {
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, #9e1c1c 100%);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 16px;
    width: 100%;
    box-shadow: 0 4px 15px var(--primary-red-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-red-glow);
}

/* --- Login Page --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(
        circle at center,
        var(--bg-card) 0%,
        var(--bg-main) 100%
    );
}

.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.8s ease forwards;
}

.logo-wrapper {
    text-align: center;
    margin-bottom: 25px;
}

.logo {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    animation: pulse-border 4s infinite linear;
    border-radius: 50%;
    padding: 5px;
    background: #fff; /* Ensure dark logos show cleanly */
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 800;
}

.form-group {
    margin-bottom: 20px;
}

/* --- Dashboard --- */
.top-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.nav-brand h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

.user-profile span {
    color: var(--primary-red);
}

.dashboard-wrapper {
    padding: 30px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Glassmorphism Classes */
.glass-card {
    background: rgba(30, 34, 39, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Welcome Hero */
.welcome-hero {
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.2) 0%, rgba(30, 34, 39, 0.8) 100%);
    border-radius: var(--radius);
    padding: 35px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeIn 0.6s ease forwards;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #fff, #ffcccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--text-secondary);
    font-size: 16px;
}

.hero-decoration {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(20px);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-row.four-cols {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
    border-radius: var(--radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
    animation: fadeIn 0.8s ease forwards;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-info h3 {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.stat-info h2 {
    font-size: 32px;
    color: var(--text-primary);
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.warning-glow {
    position: relative;
}
.warning-glow::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: var(--radius);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
    opacity: 0;
    transition: opacity 0.3s;
}
.warning-glow:hover::after {
    opacity: 1;
}

/* Creative Grid layout (replaces old Main Grid) */
.creative-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start;
}

/* Quick Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.1) 0%, rgba(30, 34, 39, 0.9) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 15px;
    text-decoration: none;
    transition: var(--transition);
    animation: fadeIn 0.7s ease forwards;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-25deg);
    transition: all 0.5s ease;
}

.action-card:hover::before {
    left: 150%;
}

.action-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-red);
    box-shadow: 0 10px 25px var(--primary-red-glow);
}

.action-icon {
    font-size: 38px;
    margin-bottom: 5px;
    display: inline-block;
    transition: var(--transition);
}

.action-card:hover .action-icon {
    transform: scale(1.1);
}

.action-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 800;
}

.action-card.secondary {
    background: linear-gradient(135deg, rgba(158, 164, 168, 0.1) 0%, rgba(30, 34, 39, 0.9) 100%);
}

.action-card.secondary:hover {
    border-color: var(--text-secondary);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.08);
}

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.chart-box {
    border-radius: var(--radius);
    padding: 25px;
    animation: fadeIn 1s ease forwards;
    position: relative;
    transition: transform 0.3s;
}
.chart-box:hover {
    transform: translateY(-3px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
}

.chart-header h3 {
    font-size: 18px;
    color: var(--text-secondary);
}

.chart-badge {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
}

.canvas-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Recent Activity Feed */
.recent-activity {
    border-radius: var(--radius);
    padding: 25px;
    animation: fadeIn 1.2s ease forwards;
}

.recent-activity h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 10px;
    display: inline-block;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.3s;
}
.activity-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.activity-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.activity-details {
    flex-grow: 1;
}

.activity-details h4 {
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 3px;
}

.activity-meta {
    color: var(--text-secondary);
    font-size: 12px;
}

.activity-amount {
    color: #2ecc71;
    font-weight: bold;
    font-size: 14px;
    background: rgba(46, 204, 113, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.view-all-link {
    display: block;
    text-align: center;
    color: var(--primary-red);
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    padding: 10px;
    border-radius: 8px;
    transition: 0.3s;
    background: rgba(211, 47, 47, 0.05);
}
.view-all-link:hover {
    background: rgba(211, 47, 47, 0.15);
}

/* Form Section */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 35px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    animation: fadeIn 1s ease forwards;
}

.form-section h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-primary);
    border-right: 4px solid var(--primary-red);
    padding-right: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

/* Full width for specific inputs */
.form-grid .full-width {
    grid-column: 1 / -1;
}

/* Responsive Enhancements for Mobile */
@media (max-width: 1024px) {
    .creative-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .welcome-hero {
        padding: 25px 20px;
    }
    .hero-content h2 {
        font-size: 24px;
    }
    
    .top-nav {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .top-actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: 10px;
        justify-content: center;
    }
    
    .btn-top-nav {
        flex: 1;
        min-width: 45%;
        justify-content: center;
        padding: 10px;
        font-size: 13px;
    }
    
    .user-profile {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
        font-size: 14px;
        background: rgba(255, 255, 255, 0.05);
        padding: 10px;
        border-radius: var(--radius);
    }

    .nav-brand h1 {
        font-size: 18px;
    }

    .dashboard-wrapper {
        padding: 15px;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
        text-align: center;
    }

    .stat-card h2 {
        font-size: 28px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 20px;
    }

    .form-section h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .btn-primary {
        padding: 12px;
        font-size: 15px;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid var(--border-color);
        margin-bottom: 15px;
        border-radius: var(--radius);
    }

    td {
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        position: relative;
        padding-right: 40%;
        text-align: left;
    }

    td:before {
        position: absolute;
        top: 12px;
        right: 15px;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: right;
        font-weight: 700;
        color: var(--text-secondary);
    }

    /* Mobile Table Labels */
    td:nth-of-type(1):before {
        content: "#";
    }
    td:nth-of-type(2):before {
        content: "اسم اللاعب:";
    }
    td:nth-of-type(3):before {
        content: "سنة المواليد:";
    }
    td:nth-of-type(4):before {
        content: "الاشتراك:";
    }
    td:nth-of-type(5):before {
        content: "الانتهاء:";
    }
    td:nth-of-type(6):before {
        content: "القيمة:";
    }
    td:nth-of-type(7):before {
        content: "الفئة:";
    }
    td:nth-of-type(8):before {
        content: "الجهة:";
    }
    td:nth-of-type(9):before {
        content: "الحالة:";
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 25px 20px;
    }
}

/* ========================================= */
/* --- NEW: Top Nav Actions CSS --- */
/* ========================================= */
.top-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: auto; /* Push to left in RTL */
    margin-left: 20px;
}

.btn-top-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    background: rgba(211, 47, 47, 0.15);
    color: var(--primary-red);
    border: 1px solid rgba(211, 47, 47, 0.3);
}

.btn-top-nav:hover {
    background: var(--primary-red);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--primary-red-glow);
}

.btn-top-nav.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-top-nav.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .top-actions {
        margin-left: 0;
    }
}
