@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    --primary: #d4af37;
    /* Premium Gold */
    --primary-dark: #b5952f;
    --primary-light: rgba(212, 175, 55, 0.2);
    --background: #0b0f19;
    /* Deep Dark Blue/Black */
    --surface: rgba(26, 32, 44, 0.7);
    /* Glassmorphism Base */
    --surface-hover: rgba(45, 55, 72, 0.9);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --danger: #ef4444;
    --success: #10b981;
    --radius: 16px;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    background: var(--background);
    /* Subtle luxury background gradient */
    background-image: radial-gradient(circle at top right, rgba(212, 175, 55, 0.1) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(212, 175, 55, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.3s ease;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Navbar */
.navbar {
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.glass-panel {
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .logo img {
    height: 30px;
    width: auto;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5));
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar .nav-links a {
    color: var(--text-main);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.navbar .nav-links a.btn {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: #000;
    /* Contrast text */
    padding: 8px 25px;
    border-radius: 30px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.navbar .nav-links a.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    color: #000;
    text-shadow: none;
}

/* Hamburger Menu (Mobile) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
    transition: 0.3s;
}

/* Hero Section Update */
.hero {
    position: relative;
    padding: 80px 0;
    flex: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.hero-content {
    flex: 1;
    text-align: right;
    animation: fadeInRight 1s ease-out;
}

.hero-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 40px;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    animation: fadeInLeft 1s ease-out;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Original fadeIn kept for other elements */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-large {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: #000 !important;
    font-size: 1.3rem;
    padding: 15px 40px;
    border-radius: 40px;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-large:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.6);
}

/* Forms */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 60px 20px;
    animation: fadeIn 0.8s ease-out;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 50px 40px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 35px;
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-submit {
    width: 100%;
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: #000;
    border: none;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5);
}

/* Dashboard Styles */
.dashboard-header {
    padding: 20px 0;
    margin-bottom: 30px;
}

.dashboard-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-welcome {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-welcome span {
    color: var(--primary);
}

.btn-logout {
    color: var(--danger);
    font-weight: 700;
    padding: 8px 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    background: rgba(239, 68, 68, 0.1);
}

.btn-logout:hover {
    background: var(--danger);
    color: #fff;
    text-shadow: none;
}

/* Portfolio Summary (Fake) */
.portfolio-summary {
    margin-bottom: 50px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.8), rgba(11, 15, 25, 0.9));
    border-left: 4px solid var(--primary);
}

.portfolio-balance {
    flex: 1;
}

.portfolio-balance h3 {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.portfolio-balance .amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.portfolio-balance .amount span {
    font-size: 1.2rem;
    color: var(--primary);
}

.portfolio-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    text-align: left;
}

.stat-item .label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-item .value {
    font-size: 1.3rem;
    font-weight: 700;
}

.stat-item .value.up {
    color: var(--success);
}

.stat-item .value.down {
    color: var(--danger);
}


.dashboard-content {
    padding-bottom: 60px;
    flex: 1;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 25px;
    background: var(--primary);
    border-radius: 4px;
}

/* Investment Cards Grid */
.investments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.invest-card {
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.invest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.05), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.invest-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.1);
}

.invest-card:hover::before {
    transform: translateX(100%);
}

.invest-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.invest-card .icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.invest-card .trend {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.invest-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.invest-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 25px;
    flex: 1;
}

.invest-card .btn-outline {
    display: block;
    text-align: center;
    padding: 12px;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 600;
    transition: 0.3s;
}

.invest-card .btn-outline:hover {
    background: var(--primary);
    color: #000;
    text-shadow: none;
}

/* Admin Table */
.admin-table-wrapper {
    overflow-x: auto;
    padding: 1px;
    /* To prevent box-shadow clipping */
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: right;
}

table th,
table td {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

table th {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.2);
}

table th:first-child {
    border-top-right-radius: 12px;
}

table th:last-child {
    border-top-left-radius: 12px;
}

table tbody tr {
    transition: 0.2s;
}

table tbody tr:hover td {
    background: rgba(212, 175, 55, 0.05);
}

table tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
}

.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    .portfolio-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .navbar .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        padding: 20px;
        border-bottom: var(--glass-border);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }

    .navbar .nav-links.active {
        display: flex;
    }

    .navbar .nav-links a {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .navbar .nav-links a.btn {
        margin-top: 10px;
    }

    .hero-layout {
        flex-direction: column;
        text-align: center;
        gap: 40px;
        padding-top: 30px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        width: 100%;
        max-width: 500px;
    }

    .dashboard-header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .auth-card {
        padding: 30px 20px;
    }
}