/* Main Styles - Dark + Blue Theme */

/* ============================================
   VARIABLES & RESETS
   ============================================ */

:root {
    --primary-dark: #1a1d29;
    --secondary-dark: #252836;
    --accent-blue: #409bdf;
    --accent-bluetwo: #4b90e2;
    --accent-blue-hover: #357ABD;
    --dusty-mauve: #AD7A99;
    --text-primary: #EDF4ED;
    --text-secondary: #A0AEC0;
    --success: #48BB78;
    --green: #79b791;
    --error: #F56565;
    --warning: #ED8936;
    --theyellow: #f5c964;
    --border: #2D3748;
    --third-dark: #31333f;
    --shadow: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
}

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

.btn-primary:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
    background: var(--secondary-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-error {
    background: var(--error);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
}

.btn-back {
    background: transparent;
    color: var(--accent-blue);
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* ============================================
   FORMS
   ============================================ */

/* Form Description Groups */
.form-description-group {
    margin-bottom: 1.5rem;
}

.form-description-group .form-description {
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-description-group .form-description:first-child {
    margin-top: 0;
}

.form-description-group .form-description:last-child {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.location-separator {
    position: relative;
    margin-bottom: 4rem; /* space before next input */
}

.location-separator::after {
    content: "";
    position: absolute;
    left: -1.5rem;
    right: -1.5rem;
    bottom: -2.4rem;   /* pushes line below dropdown */
    height: 2px;
    background-color: var(--theyellow);
}


.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="fullname"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="school"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    background: var(--secondary-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A0AEC0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select-sm {
    padding: 8px 32px 8px 12px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* ============================================
   LOADING & MESSAGES
   ============================================ */

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid rgba(74, 144, 226, 0.1);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.message.error {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.message.success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.message.warning {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.error-message {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--error);
    margin-top: 1rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    background: var(--secondary-dark);
    color: var(--text-primary);
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10000;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-info {
    border-left: 4px solid var(--accent-blue);
}

/* ============================================
   DESKTOP SIDEBAR
   ============================================ */

.desktop-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--secondary-dark);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.sidebar-header {
    padding-bottom: 0;
    border-bottom: 1px solid var(--border);
}

.gergasi-logo {
    text-align: center;
}

.gergasi-logo img {
    width: 200px;
    height: 150px;
    object-fit: contain;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(74, 144, 226, 0.1);
    color: var(--accent-blue);
}

.nav-link.active {
    background: rgba(74, 144, 226, 0.1);
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
}

.nav-link .icon {
    font-size: 1.5rem;
}

.nav-link .label {
    font-weight: 500;
}

.icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.subject-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    min-height: 100vh;
    padding: 2rem 1rem 80px;
}

/* ============================================
   MOBILE BOTTOM NAVIGATION (Hidden on desktop)
   ============================================ */

.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary-dark);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: .5px 0;
    z-index: 1000;
}

.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text-primary);
}

.mobile-nav-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mobile-nav .nav-item .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.mobile-nav .nav-item .label {
    font-size: 0.75rem;
}

.mobile-nav .nav-item.active {
    background: var(--primary-dark);
    border-bottom: 2px solid var(--accent-blue);
}

.mobile-nav .nav-item:active {
    transform: scale(0.95);
}

/* ============================================
   AUTH PAGE
   ============================================ */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background:
    url('/assets/images/background.png') no-repeat center center;
    background-size: cover;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: var(--secondary-dark);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.auth-header h1 {
    height: 150px;
    margin: 0 auto 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-header h1 img {
    width: 300px;
    height: 150px;
    object-fit: contain;
}

.auth-header p {
    display: none;
}

/* Two-column layout for registration */
.auth-container.registration-mode {
    width: 100%;
    max-width: 900px;
    display: grid;

    gap: 2rem;
    align-items: center;
}

.auth-card.registration-card {
    margin: 0;
}


.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-blue);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.form-description {
    color: var(--text-secondary);
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Back Button Outside Container */
.settings-container {
    position: relative;
    padding-bottom: 80px; /* Space for back button */
}

.btn-back-outside {
    position: absolute;
    bottom: 20px;
    left: 0;
    background: var(--accent-blue);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-back-outside:hover {
    background: var(--accent-blue-hover);
    transform: translateX(-4px);
}

/* Radio button styling */
.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.radio-label:hover {
    background: rgba(74, 144, 226, 0.1) !important;
    border-color: var(--accent-blue) !important;
    transform: translateY(-2px);
}

.radio-label input[type="radio"]:checked + span {
    color: var(--accent-blue);
    font-weight: 600;
}

.radio-label input[type="radio"]:checked ~ * {
    color: var(--accent-blue);
}

/* Style when radio button is checked */
.radio-label input[type="radio"]:checked {
    accent-color: var(--accent-blue);
}

/* Add a border effect when selected */
input[type="radio"]:checked + span {
    position: relative;
}

input[type="radio"]:checked + span::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 1px;
}

/* Religion dropdown styling */
#regReligion {
    width: 100%;
    padding: 12px 16px;
    background: var(--secondary-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#regReligion:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    outline: none;
}

#regReligion option {
    background: var(--secondary-dark);
    color: var(--text-primary);
    padding: 12px;
}


/* Forgot Password */
 .modal {
     display: none;
     position: fixed;
     z-index: 1000;
     left: 0;
     top: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0,0,0,0.7);
     overflow-y: auto;
 }

.modal-content {
    background-color: var(--secondary-dark);
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 10;
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Modal content specific styles */
#forgotPasswordModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Scrollbar styling for modal */
#forgotPasswordModal .modal-content::-webkit-scrollbar {
    width: 8px;
}

#forgotPasswordModal .modal-content::-webkit-scrollbar-track {
    background: var(--secondary-dark);
    border-radius: 4px;
}

#forgotPasswordModal .modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

#forgotPasswordModal .modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Responsive adjustments */
@media (max-height: 700px) {
    .modal-content {
        margin: 2% auto;
        max-height: 96vh;
    }

    #forgotPasswordModal h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

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

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 15px;
        margin: 2% auto;
    }

    .close-modal {
        right: 15px;
        top: 10px;
        font-size: 24px;
    }
}
