@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');

:root {
    /* Dark Theme (Default) */
    --primary-color: #001F3F;
    --secondary-color: #003366;
    --accent-color: #FFD700;
    --accent-hover: #FF8C00;
    --bg-gradient: linear-gradient(135deg, #001F3F 0%, #003366 100%);
    --text-main: #ffffff;
    --text-muted: #e0e0e0;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.05);
    --header-bg-scroll: rgba(0, 31, 63, 0.95);
    --hover-effect-color: #FF8C00;
    /* الوزن الافتراضي (برتقالي) للوضع الداكن */
    --transition-speed: 0.3s;
}

[data-theme="light"] {
    --primary-color: #f8f9fa;
    --secondary-color: #e9ecef;
    --accent-color: #003366;
    --accent-hover: #001F3F;
    --hover-effect-color: #003366;
    /* لون الـ Hover في اللايت مود (أزرق) */
    --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --text-main: #212529;
    --text-muted: #495057;
    --glass-bg: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
    --header-bg-scroll: rgba(255, 255, 255, 0.95);
    --card-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .hero h1 {
    text-shadow: none !important;
}

[data-theme="light"] .hero {
    background: url('../imgs/hero-pattern.svg'), #f8fafc;
    /* Very light neutral background */
    background-size: cover;
    filter: invert(0);
    /* Default */
}

/* We need to invert only the background image, which is hard with just 'filter' on the element */
/* Instead, let's use a pseudo-element or just change the background blend mode if possible, */
/* but the simplest is to use a light-colored version of the pattern or just a CSS-based pattern. */

[data-theme="light"] .hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../imgs/hero-pattern.svg');
    background-size: cover;
    filter: grayscale(1) invert(1) opacity(0.12);
    /* Gray pattern */
    pointer-events: none;
    z-index: 1;
    /* Keep it below content but above background */
}

.hero-content {
    position: relative;
    z-index: 10;
    /* Ensure content is above the pattern */
    max-width: 900px;
    animation: fadeInUp 1s ease-out;
}

[data-theme="light"] .brand-text .name {
    color: var(--text-main);
}

[data-theme="light"] .highlight {
    color: #003e7a !important;
}

[data-theme="light"] .hero-logo-name {
    color: #003e7a !important;
}

[data-theme="light"] .btn-register,
[data-theme="light"] .btn-submit {
    background: #003e7a !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

[data-theme="light"] .btn-register:hover,
[data-theme="light"] .btn-submit:hover {
    background: #002d59 !important;
    /* Slightly lighter than previous dark hover */
    box-shadow: none !important;
}

[data-theme="light"] .header-main-logo,
[data-theme="light"] .hero-network-logo,
[data-theme="light"] .logo {
    border-color: #0b4177 !important;
    box-shadow: none !important;
}

[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .mobile-theme-toggle:hover {
    background: #e67e22 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4) !important;
    transform: scale(1.05);
}


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

body {
    direction: rtl;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-speed), color var(--transition-speed);
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}


/* Header Styles */
header {
    padding: 12px 5%;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.8s ease-out;
    display: flex;
    align-items: center;
}

[data-theme="light"] header {
    background: transparent !important;
    border-bottom-color: transparent !important;
    backdrop-filter: none;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--glass-bg);
    padding: 10px 35px;
    /* Added internal horizontal spacing */
    border-radius: 22px;
    /* Decreased from 50px */
    border: 1px solid var(--glass-border);
    transition: all var(--transition-speed);
}

.brand:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

[data-theme="light"] .brand {
    background: rgba(0, 62, 122, 0.08);
    /* Slightly more visible in light mode */
}

.brand-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.brand-text .name {
    font-weight: 900;
    font-size: 1.2rem;
    /* Made larger to match image */
    line-height: 1.1;
    color: var(--text-main);
}

.brand-text .location {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    opacity: 0.85;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

/* Navigation & Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 22px;
    /* مساحة مريحة للزر */
    border-radius: 30px;
    /* شكل بيضاوي/Pill */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all var(--transition-speed);
    white-space: nowrap;
}

.theme-toggle i {
    font-size: 1.2rem;
    /* حجم مناسب للأيقونة داخل الزر */
}


.theme-toggle:hover {
    background: #FF8C00;
    color: white;
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.4);
    transform: scale(1.05);
    /* تكبير طفيف عند الوقوف */
}

.main-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    position: relative;
    padding: 5px 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--hover-effect-color);
    transition: width 0.3s ease;
}

.main-nav a:hover {
    color: var(--hover-effect-color);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.logo {
    height: 55px;
    width: 55px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    /* إطار شفاف في البداية */
    transition: all var(--transition-speed);
}

.header-main-logo {
    height: 45px;
    width: 45px;
    object-fit: contain;
    border-radius: 10px;
    background: white;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Hero Section */
.hero {
    height: 100vh;
    /* Fixed height to match viewport */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 10% 20px;
    /* Reduced paddings */
    background: url('../imgs/hero-pattern.svg');
    background-size: cover;
    overflow: hidden;
    /* Force content within viewport */
    position: relative;
}

.hero-logo-container {
    padding-top: 20px;
    /* Push logo down from top */
    margin-bottom: 2rem;
    animation: fadeInDown 1.2s ease-out;
}

.hero-network-logo {
    height: 180px;
    width: 180px;
    object-fit: contain;
    background: white;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-top: 20px !important;
    /* Force top margin */
    margin-bottom: 1.5rem;
}

.hero-main-title {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.hero-sub-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    /* Reduced margin */
    opacity: 0.9;
    color: var(--accent-color);
}

[data-theme="light"] .hero-main-title {
    text-shadow: none !important;
}

[data-theme="light"] .hero-sub-title {
    color: #444 !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    max-width: 900px;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.4;
    margin-bottom: 2rem;
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3);
}

.hero .highlight {
    color: var(--accent-color);
}

/* Button Styles */
.btn-register {
    display: inline-block;
    padding: 0.8rem 2.8rem;
    background-color: var(--accent-color);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 30px;
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.2);
    transition: all var(--transition-speed);
    border: 2px solid transparent;
}

.btn-register:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
    /* جعل الكلام لونه أبيض دائماً عند الـ hover */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.3);
}

.login-prompt {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.login-prompt a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.login-prompt a:hover {
    color: var(--hover-effect-color);
    text-decoration: none;
}


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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.mobile-only {
    display: none;
}


.menu-toggle {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all var(--transition-speed);
}

.menu-toggle:hover {
    background: #FF8C00;
    color: white;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .nav-actions .theme-toggle {
        display: none;
        /* إخفاء الزر من الهيدر في الموبايل */
    }

    .mobile-only {
        display: block;
    }


    .main-nav {
        display: none;
        /* Hide main nav by default on tablets/mobiles */
        position: fixed;
        top: 80px;
        right: 0;
        width: 100%;
        background: var(--header-bg-scroll);
        padding: 2rem;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .menu-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .mobile-theme-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        color: var(--text-main);
        padding: 12px 24px;
        border-radius: 30px;
        cursor: pointer;
        font-family: inherit;
        font-weight: 600;
        transition: all 0.3s ease;
        margin-top: 15px;
        width: auto;
        /* إلغاء العرض الثابت */
        height: auto;
        /* إلغاء الطول الثابت */
    }

    .mobile-theme-toggle:hover {
        background: #FF8C00;
        color: white;
    }
}


@media (max-width: 768px) {
    .brand-text .name {
        font-size: 0.95rem;
    }

    .brand-text .location {
        font-size: 0.75rem;
    }

    .logo {
        height: 45px;
        width: 45px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .btn-register {
        padding: 0.7rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .brand-text {
        display: none;
        /* Hide text on very small screens to save space */
    }

    .header-content {
        gap: 10px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }
}



/* إخفاء أيقونة التقويم السوداء الافتراضية في المتصفح */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

.register-main {
    min-height: 100vh;
    padding: 120px 5% 50px;
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.register-wrapper {
    width: 100%;
    max-width: 800px;
    animation: fadeInUp 0.8s ease-out;
}

.register-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

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

.form-header h2 {
    font-size: 2.2rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Profile Upload Section */
.profile-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.5rem;
}

.profile-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 3px solid var(--accent-color);
    /* بوردر متصل وبلون ذهبي ليظهر بوضوح */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.profile-preview-wrapper {
    position: relative;
    display: inline-block;
}

.remove-img-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 32px;
    height: 32px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    /* يظهر فقط عند وجود صورة */
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.remove-img-btn:hover {
    background: #ff0000;
    transform: scale(1.1);
}

.remove-profile-btn {
    margin-top: 10px;
    background: #ef4444;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    display: none;
    /* مخفي افتراضياً ويظهر عند رفع صورة */
    align-items: center;
    gap: 5px;
    transition: 0.3s;
}

.remove-profile-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.profile-preview:hover {
    border-color: var(--accent-color);
    background: rgba(255, 215, 0, 0.05);
}

.profile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-preview i.fas.fa-user {
    font-size: 3rem;
    color: var(--text-muted);
}

.upload-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 35%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: 0.3s;
}

.profile-preview:hover .upload-overlay {
    opacity: 1;
}

.upload-label {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Detailed Grid Form Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.required {
    color: #ff4d4d;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0 15px;
    transition: all 0.3s ease;
}

[data-theme="light"] .input-wrapper {
    background: rgba(0, 0, 0, 0.02);
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
    background: var(--glass-bg);
}

.input-wrapper i:first-child {
    font-size: 1.1rem;
    color: #ffffff;
    /* جعل الأيقونة بلون أبيض في الوضع الداكن */
    flex-shrink: 0;
}

[data-theme="light"] .input-wrapper i:first-child {
    color: var(--accent-color);
    /* اللون الأزرق في الوضع الفاتح */
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 0.8rem 0;
    border: none !important;
    background: transparent !important;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none !important;
}

/* تحسين القائمة المنسدلة */
select option {
    background-color: #ffffff;
    color: #212529;
    padding: 12px;
}

/* Validation Colors & Messages */
.form-group.success .input-wrapper input {
    border-color: #10b981 !important;
}

.form-group.error .input-wrapper input {
    border-color: #ef4444 !important;
}

.error-msg {
    color: #ef4444;
    font-size: 0.8rem;
    display: none;
    padding-right: 5px;
}

.form-group.error .error-msg {
    display: block;
}

/* Specific Interactive Elements */
.toggle-password {
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.3s;
    margin-right: auto;
    /* دفع العين لأقصى اليسار في الفليكس */
}

.toggle-password:hover {
    color: var(--accent-color);
}

.radio-group {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.radio-option input {
    accent-color: var(--accent-color);
    width: 18px;
    height: 18px;
}


/* Main Submission Button */
.btn-submit {
    width: 100%;
    margin-top: 2rem;
    padding: 1.1rem;
    border-radius: 15px;
    border: none;
    background: var(--accent-color);
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

.btn-submit:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 140, 0, 0.3);
}

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

.form-footer {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.form-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
}

/* Tablet & Mobile Responsiveness for Form */
@media (max-width: 768px) {
    .register-main {
        padding: 100px 15px 40px;
    }

    .register-card {
        padding: 2.5rem 1.5rem;
    }

    .form-header h2 {
        font-size: 1.8rem;
    }

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

    .form-group.full-width {
        grid-column: span 1;
    }

    .radio-group {
        flex-direction: column;
        gap: 1.2rem;
    }
}