:root {
    --primary-color: #53245e;
    /* Purple */
    --secondary-color: #389197;
    /* Teal */
    --accent-color: #d44f69;
    /* Pink/Red */
    --bg-color: #f8f9fa;
    --text-color: #333;
    --card-bg: #ffffff;
}

body {
    font-family: 'Tajawal', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    direction: rtl;
    text-align: right;
}

.app-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Auth Section */
.auth-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
    text-align: center;
    transition: transform 0.3s ease;
    margin: 0 auto;
    /* Ensure centering in block layout */
}

.logo-area {
    margin-bottom: 2rem;
}

.logo-img {
    max-width: 180px;
    height: auto;
    margin-bottom: 1rem;
}

.logo-area h1 {
    display: none;
    /* Hide text h1 when logo is present */
}

.logo-area p {
    color: #666;
    font-size: 0.95rem;
    margin-top: -10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #333;
}

.btn-text {
    background: none;
    border: none;
    color: #666;
    margin-top: 1rem;
    cursor: pointer;
    text-decoration: underline;
}

#recaptcha-container {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

/* Dashboard */
.top-nav {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-brand {
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-container {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.status-card,
.profile-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    margin: 10px 0;
}

.badge.pending {
    background: #fff3cd;
    color: #856404;
}

.badge.approved {
    background: #d4edda;
    color: #155724;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.info-item label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.info-item span,
.info-item a {
    font-weight: 500;
    font-size: 1.1rem;
    color: #333;
}

/* Form Styling */
.form-section-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
    color: var(--primary-color);
    text-align: right;
}

.form-group {
    text-align: right;
}

input,
select {
    text-align: right;
}

/* Exceptions for LTR data */
input[type="email"],
input[type="url"],
input[type="tel"] {
    direction: ltr;
    text-align: right;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #eee;
    text-align: right;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    text-align: right;
    justify-content: flex-start;
    /* Starts from right in RTL */
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.radio-group {
    display: flex;
    gap: 2rem;
    text-align: right;
    justify-content: flex-start;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.file-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    direction: rtl;
}

@media (max-width: 600px) {
    .file-upload-grid {
        grid-template-columns: 1fr;
    }
}

.specialty-block {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.specialty-block h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #555;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet and below */
@media (max-width: 768px) {

    /* General padding and spacing */
    .app-container {
        padding: 10px;
    }

    .auth-card {
        padding: 1.5rem;
        margin: 10px;
    }

    /* Top Navigation */
    .top-nav {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .nav-user {
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    /* Content Container */
    .content-container {
        padding: 1rem;
    }

    /* Cards */
    .status-card,
    .profile-summary,
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }

    /* Checkbox and Radio Groups */
    .checkbox-group,
    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Project Grid */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Project Card */
    .project-card {
        padding: 1rem;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .project-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .project-actions button {
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
        padding: 8px;
    }

    /* Tables - Make scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
        white-space: nowrap;
    }

    /* Modals */
    .modal-content {
        width: 95% !important;
        margin: 10% auto;
        padding: 15px;
        max-height: 85vh;
        overflow-y: auto;
    }

    /* Logo */
    .logo-img {
        max-width: 140px;
    }

    #registration-section {
        padding: 1rem;
    }

    .registration-card {
        padding: 1.5rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.25rem;
    }

    .top-nav {
        padding: 0.5rem 0.75rem;
    }

    .nav-brand {
        font-size: 0.9rem;
    }

    .content-container {
        padding: 0.75rem;
    }

    .card {
        padding: 0.75rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Project Actions - Stack vertically on very small screens */
    .project-actions {
        flex-direction: column;
    }

    .project-actions button {
        width: 100%;
    }

    /* Modal full screen on small devices */
    .modal-content {
        width: 100% !important;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }

    .logo-img {
        max-width: 120px;
    }

    /* Smaller buttons on mobile */
    .btn-small {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}