/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #05080f; /* كحلي داكن جدًا */
    color: #ffffff; /* نص أبيض فقط */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

/* ===== الإطار الرئيسي ===== */
.validator-frame {
    width: 100%;
    max-width: 960px;
    background-color: #0a0f1c;
    border: 1px solid #1a2438;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* ===== الهيدر ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1a2438;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== الأزرار العامة ===== */
.btn {
    background-color: #111a2e;
    color: #ffffff;
    border: 1px solid #1a2438;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
    background-color: #1a2438;
    border-color: #2d3f63;
}

.btn-primary {
    background-color: #1a2a4a;
    border-color: #2d4a7a;
}

.btn-primary:hover {
    background-color: #233a63;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* ===== منطقة الفحص ===== */
.editor-section {
    margin-bottom: 24px;
}

.editor-section label {
    display: block;
    font-size: 0.85rem;
    color: #8a9bb8;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#html-input {
    width: 100%;
    min-height: 280px;
    background-color: #05080f;
    border: 1px solid #1a2438;
    border-radius: 12px;
    padding: 20px;
    color: #ffffff;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

#html-input:focus {
    border-color: #2d3f63;
}

.actions {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

/* ===== النتائج ===== */
.results-section {
    margin-top: 8px;
    margin-bottom: 28px;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #8a9bb8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#result-badge {
    display: none;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-valid {
    background-color: #0f2a1f;
    color: #4ade80;
    border: 1px solid #1a4a33;
}

.badge-invalid {
    background-color: #2a0f14;
    color: #f87171;
    border: 1px solid #4a1a24;
}

#messages-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-item {
    background-color: #05080f;
    border: 1px solid #1a2438;
    border-left: 3px solid #6b7a96;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message-item.error {
    border-left-color: #f87171;
}

.message-item.warning {
    border-left-color: #fbbf24;
}

.message-item .msg-rule {
    font-size: 0.75rem;
    color: #6b7a96;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.message-item .msg-text {
    color: #ffffff;
}

.placeholder-text {
    color: #4a5a7a;
    font-style: italic;
    padding: 20px 0;
    text-align: center;
}

/* ===== البراويز المخصصة ===== */
.frame {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #1a2438;
    border-radius: 14px;
    background-color: #05080f;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.frame h2 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #ffffff;
}

.frame-subtitle {
    font-size: 0.75rem;
    color: #6b7a96;
    margin-bottom: 12px;
}

/* ===== المفكرة ===== */
#notes-input {
    width: 100%;
    min-height: 100px;
    background-color: #0a0f1c;
    border: 1px solid #1a2438;
    border-radius: 10px;
    padding: 14px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

#notes-input:focus {
    border-color: #2d3f63;
}

.notes-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ===== المميزات ===== */
.features-list {
    list-style: none;
    padding: 0;
    margin-bottom: 16px;
}

.features-list li {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #c0cce0;
    padding: 4px 0;
    border-bottom: 1px solid #111a2e;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list strong {
    color: #ffffff;
}

.features-list code {
    background-color: #111a2e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ===== أزرار اللغات ===== */
.language-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #1a2438;
}

.lang-btn {
    color: #8a9bb8;
    background-color: transparent;
    border: 1px solid #1a2438;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.lang-btn:hover {
    background-color: #1a2438;
    color: #ffffff;
    border-color: #2d3f63;
}

/* ===== برواز التواصل ===== */
.contact-frame {
    text-align: center;
}

.frame-flags {
    font-size: 1rem;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.frame-contact {
    font-size: 0.85rem;
    color: #ffffff;
    margin-bottom: 4px;
    font-weight: 500;
}

.frame-text {
    font-size: 0.75rem;
    color: #6b7a96;
    letter-spacing: 0.03em;
}

/* ===== برواز الشكر ===== */
.thanks-frame {
    text-align: center;
}

.thanks-text {
    font-size: 0.8rem;
    color: #8a9bb8;
    line-height: 1.7;
    font-style: italic;
}

/* ===== الساعة والتاريخ ===== */
.datetime-frame {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #1a2438;
    font-size: 0.75rem;
    color: #4a5a7a;
    letter-spacing: 0.05em;
}

#live-clock {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

#live-date {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

/* ===== زر العودة العائم ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #1a2a4a;
    color: #ffffff;
    border: 1px solid #2d4a7a;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.back-to-top:hover {
    background-color: #233a63;
}

.back-to-top.visible {
    display: flex;
}

/* ===== استجابة للشاشات الصغيرة ===== */
@media (max-width: 600px) {
    .validator-frame {
        padding: 20px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
        text-align: center;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
    }

    .language-buttons {
        gap: 8px;
    }

    .lang-btn {
        font-size: 0.7rem;
        padding: 6px 12px;
    }

    .datetime-frame {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }
}
