/* General */
body { margin: 0; font-family: 'Tajawal', sans-serif; background: linear-gradient(to bottom, #0A0A23, #000000); color: #f0f0f0; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; text-align: center; overflow-x: hidden; padding: 20px 0; box-sizing: border-box;}
#stars-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.container { max-width: 600px; width: 90%; z-index: 1; }
header h1 { font-size: 2.8rem; font-weight: 700; margin-bottom: 20px; color: #ffffff; }
.prompt-message { font-size: 1.2rem; margin-bottom: 25px; font-weight: 400; }
/* Forms */
textarea { width: 100%; height: 150px; padding: 15px; border-radius: 8px; border: 1px solid #333; background-color: rgba(255, 255, 255, 0.05); color: #f0f0f0; font-size: 1rem; font-family: inherit; resize: vertical; box-sizing: border-box; }
textarea:focus { outline: none; border-color: #4a90e2; box-shadow: 0 0 10px rgba(74, 144, 226, 0.5); }
button { margin-top: 20px; padding: 12px 30px; font-size: 1.1rem; font-family: inherit; font-weight: 700; color: #ffffff; background-color: #4a90e2; border: none; border-radius: 50px; cursor: pointer; transition: background-color 0.3s, transform 0.2s; }
button:hover { background-color: #357abd; transform: translateY(-2px); }
/* Options */
.options-container { margin: 25px 0; display: flex; flex-direction: column; gap: 20px; text-align: start; }
.option { display: flex; align-items: center; gap: 10px; }
.option label { color: #ccc; cursor: pointer; }
.option input[type="email"] { flex-grow: 1; padding: 10px; border-radius: 5px; border: 1px solid #333; background-color: rgba(255, 255, 255, 0.05); color: #f0f0f0; font-family: inherit; }
.option input[type="checkbox"] { width: 1.3em; height: 1.3em; cursor: pointer; }
/* Footer */
footer { margin-top: 50px; font-size: 1rem; color: #aaa; line-height: 1.6; width: 100%; }
.footer-links { margin-bottom: 20px; }
.footer-links a { color: #8bbfff; text-decoration: none; margin: 0 15px; font-size: 1.1rem; }
footer p { margin: 5px 0; }
footer a { color: #4a90e2; text-decoration: none; transition: color 0.3s; }
footer a:hover { color: #8bbfff; }
.logos-container { margin-top: 20px; display: flex; justify-content: center; align-items: center; gap: 25px; }
.logos-container img { height: 60px; width: auto; }
/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: #0A0A23; border: 1px solid #4a90e2; border-radius: 10px; padding: 20px 30px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5); animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.modal-header h3 { font-family: inherit; color: #ffffff; font-size: 1.2rem; margin: 0 0 15px 0; }
.modal-body p { color: #f0f0f0; font-size: 1rem; margin: 0; }
.modal-footer { margin-top: 25px; }
#modal-close-button, .popup-close-button { padding: 10px 25px; font-size: 1rem; font-family: inherit; font-weight: 700; color: #ffffff; background-color: #4a90e2; border: none; border-radius: 50px; cursor: pointer; transition: background-color 0.3s; }
#modal-close-button:hover, .popup-close-button:hover { background-color: #357abd; }
/* Capsule Page */
.capsule-content { background-color: rgba(255, 255, 255, 0.05); border: 1px solid #333; border-radius: 10px; padding: 30px; margin-top: 20px; text-align: right; max-width: 100%; word-wrap: break-word; opacity: 0; transform: translateY(20px); transition: opacity 1s ease 2.5s, transform 1s ease 2.5s; }
html[dir="ltr"] .capsule-content { text-align: left; }
.capsule-content.visible { opacity: 1; transform: translateY(0); }
.capsule-content p { font-size: 1.2rem; line-height: 1.8; white-space: pre-wrap; margin: 0; }
.date-stamp { margin-top: 30px; font-size: 0.9rem; color: #888; text-align: center; }
.creation-section { margin-top: 50px; }
.back-link { display: inline-block; color: #aaa; text-decoration: none; border: 1px solid #555; padding: 10px 20px; border-radius: 50px; transition: all 0.3s; }
.back-link:hover { background-color: #4a90e2; color: #fff; border-color: #4a90e2; }
#countdown-timer { text-align: center; }
#countdown-timer .time-unit { display: inline-block; margin: 0 15px; }
#countdown-timer .time-value { font-size: 3rem; font-weight: 700; color: #ffffff; line-height: 1; }
#countdown-timer .time-label { font-size: 1rem; color: #aaa; }
#cosmic-message { font-size: 1.3rem; color: #a7c7e7; line-height: 2; text-shadow: 0 0 10px rgba(173, 216, 230, 0.7); opacity: 0; animation: fadeInGlow 3s forwards 0.5s; margin-bottom: 40px; }
@keyframes fadeInGlow { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
/* Gallery Page */
#gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 30px; }
.capsule-card { background-color: rgba(255, 255, 255, 0.05); border: 1px solid #444; border-radius: 8px; padding: 20px; text-align: start; cursor: pointer; transition: all 0.3s ease; }
.capsule-card:hover { transform: translateY(-5px); border-color: #4a90e2; }
.card-message { font-style: italic; color: #ccc; margin: 0 0 15px 0; }
.card-date { font-size: 0.8rem; color: #888; }

/* === بداية تنسيقات خيارات المدة === */

.time-options-container {
    width: 100%;
    max-width: 500px;
    margin: 25px auto 20px auto;
    text-align: center;
}

.time-options-container p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #c0c0c0;
    text-align: start;
}

html[dir="rtl"] .time-options-container p {
    text-align: right;
}

.time-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px 15px;
}

html[dir="rtl"] .time-options {
    justify-content: flex-end;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    display: none; /* إخفاء الزر الأصلي */
}

.radio-option label {
    cursor: pointer;
    padding-left: 28px; /* مسافة للنص */
    position: relative;
    font-size: 1rem;
    color: #ddd;
}

/* إنشاء زر مخصص */
.radio-option label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #aaa;
    border-radius: 50%;
    background-color: transparent;
    transition: border-color 0.3s;
}

.radio-option:hover label::before {
    border-color: #4a90e2;
}

/* الدائرة الداخلية عند الاختيار */
.radio-option input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #4a90e2;
}

.radio-option input[type="radio"]:checked + label {
    color: #ffffff;
    font-weight: 700;
}

/* === تنسيقات خاصة باللغة العربية (RTL) === */
html[dir="rtl"] .radio-option {
    flex-direction: row-reverse;
}

html[dir="rtl"] .radio-option label {
    padding-left: 0;
    padding-right: 28px; /* تغيير المسافة لتكون على اليمين */
}

html[dir="rtl"] .radio-option label::before {
    left: auto;
    right: 0; /* وضع الزر المخصص على اليمين */
}

html[dir="rtl"] .radio-option input[type="radio"]:checked + label::after {
    left: auto;
    right: 5px; /* وضع الدائرة الداخلية على اليمين */
}

/* === نهاية تنسيقات خيارات المدة === */
