/* CSS Variables derived from SCSS */
:root {
    --primary: #2C6B4F;
    --primary-dark: #17482D;
    --secondary: #C59B2A;
    --secondary-soft: #E0B84C;
    --body-bg: #F8F8F6;
    --text-color: #2B2B2B;
    --muted-text: #6C757D;
    --border-color: #E5E5E5;
}

/* Global Reset / Base */
body {
    background-color: var(--body-bg);
    color: var(--text-color);
    font-family: "Cairo", "Noto Kufi Arabic", sans-serif;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5 {
    font-weight: 600;
    color: var(--primary);
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: #a38023; /* darken secondary approx 10% */
    text-decoration: underline;
}

/* Navbar Setup */
#page-wrapper {
    padding-top: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.navbar {
    background: linear-gradient(to bottom, #2C6B4F, #1F5F3B) !important;
    position: sticky;
    top: 10px;
    z-index: 1050;
    margin: 0 auto;
    width: calc(100% - 40px);
    max-width: 1200px;
    border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
}

.navbar:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.container-fluid {
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none !important;
}

.navbar-brand:hover {
    color: #ffffff;
}

.navbar-toggler {
    background-color: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    display: none;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='white' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.navbar-collapse {
    display: flex;
    flex-basis: auto;
    align-items: center;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
    margin: 0;
}

.nav-item {
    margin-left: 10px;
    margin-right: 0;
}

.nav-link {
    color: #ffffff !important;
    font-weight: 500;
    padding: 8px 12px;
    display: block;
    position: relative;
    padding-bottom: 6px;
    text-decoration: none !important;
    border-radius: 6px;
}

.nav-link.active,
.nav-link:focus,
.nav-link:hover {
    background-color: var(--secondary) !important;
    color: white !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
}


/* Mobile Adjustments */
@media (max-width: 768px) {
    /* Tighten navbar height */
    .navbar {
        width: calc(100% - 40px);
        border-radius: 15px;
        padding: 5px 10px !important;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-items: stretch;
    }

    /* Container for the navbar elements */
    .container-fluid {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100%;
        padding: 0 10px !important; /* إضافة مسافة جانبية */
        gap: 20px; /* إضافة مسافة بين الشعار والزر */
    }

    /* Ensure toggler is visible */
    .navbar-toggler {
        display: block !important;
    }

    /* Hide menu by default */
    .navbar-collapse {
        display: none !important;
        width: 100%;
        margin-top: -10px;
        padding-top: 50px;
        /* margin-top: 10px; */
    }

    /* Show as white card when active */
    .navbar-collapse.show {
        display: block !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ebeccb87;
        border: 2px solid var(--primary);
        border-top: 0px;
        border-bottom-right-radius: 20px;
        border-bottom-left-radius: 20px;
        padding: 10px;
        padding-top: 40px;
        /* margin-top: 10px; */
        color: var(--primary);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        z-index: 1000;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* FIX: Remove default browser padding that pushed elements left */
    .navbar-nav {
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .nav-item {
        margin: 2px 0;
        width: 100%;
    }

    .nav-link {
        color: var(--primary) !important;
        text-align: center;
        padding: 8px !important;
        border-radius: 8px;
        background-color: transparent !important;
        display: block;
    }

    .nav-link:hover {
        background-color: rgba(44, 107, 79, 0.1) !important;
    }
}

/* Main Content & Cards */
.main-content {
    /* width: 60%; */
    max-width: 500px;
    margin: 60px auto;
    padding: 0 15px;
}

.card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
    padding: 30px;
    max-width: 500px;
}



.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.card-title {
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    color: var(--muted-text);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 25px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    transition: all 0.2s ease-in-out;
    text-align: left;
    direction: ltr;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(197, 155, 42, 0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 10px 20px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    width: 100%;
    border: 1px solid transparent;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-top: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    text-align: center;
}

.alert-info {
    background-color: rgba(31, 95, 59, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.alert-warning {
    background-color: rgba(197, 155, 42, 0.15);
    border-color: var(--secondary);
    color: #856404;
}

.username-badge {
    display: inline-block;
    background-color: #fff;
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.1rem;
    margin-top: 10px;
    border: 1px solid var(--primary);
    font-weight: bold;
}

/* Footer */
#page-footer {
    background-color: var(--primary);
    color: #fff;
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
}

#page-footer a {
    color: var(--secondary-soft);
}

#page-footer a:hover {
    color: #fff;
}


/* Mobile Adjustments */
@media (max-width: 768px) {
    .main-content{
        max-width: 90%!important;
    }
    .card{
        max-width: 100%;
    }
}