/* ============================================================
   Tinder App - Stylesheet
   الإصدار: 2.0 (مصحح ومحسن)
   تم الحفاظ على جميع الألوان الأصلية
   ============================================================ */

/* ========== إعدادات عامة ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: #0A0A0A;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 16px;
    margin: 0;
    overflow: hidden;
}

/* ========== إطار الهاتف ========== */
.phone-frame {
    max-width: 390px;
    width: 100%;
    background: #121212;
    border-radius: 42px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.03);
    padding: 30px 24px 30px;
    min-height: 700px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* ========== الشاشات ========== */
.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    flex: 1;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 10px;
}

.screen.active {
    display: flex;
}

/* ========== أنيميشن الدخول ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* ========== الشعلة ========== */
.flame-emoji {
    font-size: 70px;
    line-height: 1;
    text-align: center;
    margin: 5px 0 0 0;
    filter: drop-shadow(0 0 30px rgba(255, 59, 48, 0.25));
    animation: pulse 2s ease-in-out infinite;
    user-select: none;
}

/* ========== العناوين الرئيسية ========== */
.app-title {
    font-size: 36px;
    font-weight: 900;
    text-align: center;
    color: #FFFFFF;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.sub-title {
    font-size: 15px;
    font-weight: 400;
    color: #8e8e93;
    text-align: center;
    margin-bottom: 25px;
}

.question-title {
    font-size: 24px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 6px;
    line-height: 1.2;
}

.question-sub {
    font-size: 14px;
    font-weight: 400;
    color: #8e8e93;
    margin-bottom: 20px;
}

/* ========== النصوص الفرعية ========== */
.rules-list {
    list-style: none;
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rules-list li {
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
}

.rules-list li:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.06);
}

.rules-list li .text span {
    font-size: 13px;
    font-weight: 400;
    color: #8e8e93;
    display: block;
    margin-top: 2px;
}

.rules-list li .text strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
}

.hint-text {
    font-size: 13px;
    font-weight: 400;
    color: #8e8e93;
    margin: 10px 0;
    line-height: 1.5;
}

.hint-text strong {
    color: #FF3B30;
    font-weight: 700;
}

.info-box {
    background: rgba(255, 255, 255, 0.04);
    padding: 18px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin: 10px 0 20px;
    transition: all 0.2s ease;
}

.info-box p {
    font-size: 17px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.info-box small {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #8e8e93;
    margin-top: 4px;
}

.footer-note {
    font-size: 12px;
    font-weight: 400;
    color: #48484a;
    text-align: center;
    margin-top: 20px;
}

.footer-note a {
    color: #FF3B30;
    text-decoration: none;
}

/* ========== المسافات ========== */
.spacer {
    flex: 1;
    min-height: 10px;
}

/* ========== الأزرار الرئيسية ========== */
.btn-primary {
    background: linear-gradient(135deg, #FF3B30, #FF5A3A);
    border: none;
    color: white;
    font-family: 'Tajawal', sans-serif;
    font-size: 20px;
    font-weight: 800;
    padding: 18px;
    border-radius: 40px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(255, 59, 48, 0.2);
    margin-top: 12px;
    position: relative;
    overflow: hidden;
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 5px 15px rgba(255, 59, 48, 0.2);
}

.btn-primary:disabled {
    background: #333;
    box-shadow: none;
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:not(:disabled):hover {
    box-shadow: 0 10px 40px rgba(255, 59, 48, 0.4);
}

/* ========== الأزرار الثانوية ========== */
.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.12);
    color: #8e8e93;
    font-family: 'Tajawal', sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 16px;
    border-radius: 40px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
    margin-top: 10px;
}

.btn-secondary:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

/* ========== نقاط التقدم ========== */
.progress-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 0 10px;
}

.progress-steps .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    transition: all 0.3s ease;
    cursor: default;
}

.progress-steps .dot.active {
    background: #FF3B30;
    width: 28px;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.3);
}

.progress-steps .dot.done {
    background: #FF3B30;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.2);
}

/* ========== حقول الإدخال ========== */
.input-group {
    width: 100%;
    margin-bottom: 15px;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 16px 18px;
    font-size: 18px;
    font-family: 'Tajawal', sans-serif;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: #FFF;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: #FF3B30;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.08);
}

.input-group input::placeholder {
    color: #48484a;
}

.input-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== حالة الخطأ للحقول ========== */
.input-group input.error {
    border-color: #FF3B30;
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.15);
    animation: shake 0.5s ease;
}

/* ========== تلميحات الحقول ========== */
.input-hint {
    font-size: 12px;
    color: #48484a;
    margin-top: 5px;
    padding: 0 4px;
    transition: all 0.3s ease;
}

.input-hint.error {
    color: #FF3B30;
}

.input-hint.success {
    color: #34c759;
}

/* ========== روابط التعديل والرجوع ========== */
.edit-link {
    text-align: center;
    margin-top: 12px;
}

.edit-link a {
    color: #8e8e93;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.edit-link a:hover {
    color: #FF3B30;
}

.back-link {
    text-align: center;
    margin-top: 12px;
}

.back-link a {
    color: #48484a;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.back-link a:hover {
    color: #FF3B30;
}

/* ========== خطأ المصادقة ========== */
.auth-error {
    color: #FF3B30;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
    min-height: 24px;
    transition: all 0.3s ease;
}

.auth-error.success {
    color: #34c759;
}

/* ========== شبكة الصور ========== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.photo-slot {
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #48484a;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.photo-slot:active {
    transform: scale(0.95);
}

.photo-slot .label {
    font-size: 12px;
    margin-top: 4px;
    color: #666;
    font-weight: 500;
}

.photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
}

.photo-slot img:hover {
    transform: scale(1.05);
}

.photo-slot.filled {
    border-color: #FF3B30;
    border-style: solid;
    background: rgba(255, 59, 48, 0.05);
}

/* ========== تحميل الصور ========== */
#uploadLoading {
    text-align: center;
    color: #8e8e93;
    padding: 10px;
    font-size: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========== شبكة الاهتمامات ========== */
.interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.interest-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.08);
    color: #aaa;
    padding: 10px 18px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Tajawal', sans-serif;
    user-select: none;
}

.interest-tag:active {
    transform: scale(0.95);
}

.interest-tag.selected {
    background: #FF3B30;
    border-color: #FF3B30;
    color: #FFF;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}

.interest-tag:hover:not(.selected) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ========== خيارات نمط الحياة والنوايا ========== */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.option-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    color: #aaa;
    padding: 12px 20px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Tajawal', sans-serif;
    flex: 1 0 auto;
    text-align: center;
    user-select: none;
}

.option-btn:active {
    transform: scale(0.95);
}

.option-btn.selected {
    background: #FF3B30;
    border-color: #FF3B30;
    color: #FFF;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}

.option-btn:hover:not(.selected) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.lifestyle-question {
    color: #FFFFFF;
    font-weight: 700;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 16px;
}

/* ========== شاشة البطاقات ========== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 5px;
    margin-bottom: 10px;
}

.card-header .logo {
    color: #FFFFFF;
    font-size: 26px;
    font-weight: 900;
}

.card-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
    min-height: 400px;
    max-height: 500px;
}

/* ========== البطاقات ========== */
.card {
    position: absolute;
    width: 100%;
    height: 400px;
    border-radius: 24px;
    background: #1e1e1e;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    cursor: grab;
    will-change: transform;
}

.card:active {
    cursor: grabbing;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card img:hover {
    transform: scale(1.02);
}

.card .card-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #FFF;
}

.card .card-footer h2 {
    font-size: 26px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.card .card-footer p {
    font-size: 16px;
    font-weight: 400;
    color: #cccccc;
}

.card .card-footer .school-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 13px;
    color: #aaaaaa;
    font-weight: 400;
    margin-top: 4px;
}

/* ========== أزرار الإجراءات ========== */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 10px 0;
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #1e1e1e;
    color: #FFF;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.15s ease;
    font-family: 'Tajawal', sans-serif;
    user-select: none;
}

.action-btn:active {
    transform: scale(0.85);
}

.action-btn.nope {
    color: #FF3B30;
    border: 3px solid #FF3B30;
    background: transparent;
}

.action-btn.nope:hover {
    background: rgba(255, 59, 48, 0.1);
}

.action-btn.like {
    color: #34c759;
    border: 3px solid #34c759;
    background: transparent;
}

.action-btn.like:hover {
    background: rgba(52, 199, 89, 0.1);
}

.action-btn.super {
    color: #5ac8fa;
    border: 3px solid #5ac8fa;
    background: transparent;
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

.action-btn.super:hover {
    background: rgba(90, 200, 250, 0.1);
}

/* ========== الحالة الفارغة ========== */
.empty-state {
    text-align: center;
    color: #8e8e93;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.empty-state .big-emoji {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
}

/* ========== زر تسجيل الخروج ========== */
.logout-btn {
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: color 0.2s ease;
    padding: 8px 12px;
    border-radius: 40px;
}

.logout-btn:hover {
    color: #FF3B30;
    background: rgba(255, 59, 48, 0.05);
}

.logout-btn:active {
    transform: scale(0.95);
}

/* ========== زر التثبيت ========== */
#installBtn {
    background: #FF3B30;
    border: none;
    color: #FFF;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.2s ease;
}

#installBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.4);
}

#installBtn:active {
    transform: scale(0.95);
}

/* ========== تحسينات للشاشات الصغيرة ========== */
@media (max-width: 420px) {
    .phone-frame {
        padding: 20px 16px 20px;
        min-height: 600px;
        border-radius: 32px;
    }

    .app-title {
        font-size: 30px;
    }

    .question-title {
        font-size: 20px;
    }

    .flame-emoji {
        font-size: 50px;
    }

    .btn-primary {
        font-size: 17px;
        padding: 15px;
    }

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

    .card {
        height: 350px;
    }

    .card .card-footer h2 {
        font-size: 22px;
    }

    .action-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .action-btn.super {
        width: 60px;
        height: 60px;
    }

    .photo-grid {
        gap: 8px;
    }

    .interest-tag {
        font-size: 13px;
        padding: 8px 14px;
    }

    .option-btn {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* ========== تحسينات للشاشات الكبيرة ========== */
@media (min-width: 600px) {
    .phone-frame {
        max-width: 450px;
        min-height: 750px;
    }

    .card {
        height: 450px;
    }
}

/* ========== منع التحديد ========== */
.no-select {
    user-select: none;
    -webkit-user-select: none;
}

/* ========== سكرول مخصص ========== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== إعدادات الطباعة ========== */
@media print {
    .phone-frame {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .action-btn,
    .btn-primary,
    .btn-secondary {
        display: none;
    }
}