:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --accent: #FFC107;
    --bg-gradient: linear-gradient(135deg, #090d16 0%, #1e1b4b 50%, #1e3a8a 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --radius: 20px;
    --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 25px 15px;
    position: relative;
    overflow-x: hidden;
}

/* اللوغو المائل في الخلفية العامة */
.watermark-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    width: 550px;
    height: 550px;
    opacity: 0.035;
    pointer-events: none;
    z-index: 0;
    object-fit: contain;
}

.container {
    width: 100%;
    max-width: 950px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 15px;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

/* شريط التنقل العلوي */
.top-nav-bar {
    background: #0f172a;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    gap: 10px;
}

.student-portal-btn {
    background: var(--accent);
    color: var(--text-main);
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.student-portal-btn:hover {
    transform: scale(1.05);
}

.lang-group {
    display: flex;
    gap: 8px;
}

.lang-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: background 0.2s;
}

.lang-btn:hover, .lang-btn.active {
    background: var(--accent);
    color: var(--text-main);
}

/* رأس الصفحة الفخم باللوغو */
header {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.92), rgba(29, 78, 216, 0.92)), url('logo.png');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 4px solid var(--accent);
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 15%;
    background-image: url('logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 280px;
    opacity: 0.12;
    pointer-events: none;
}

header img.logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid var(--accent);
    object-fit: cover;
    margin-bottom: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    background: #fff;
    position: relative;
    z-index: 2;
}

header h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}

header p {
    font-size: 1rem;
    color: #fbbf24;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.screen {
    padding: 40px 30px;
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.05rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 1.05rem;
    outline: none;
    background: #f8fafc;
}

/* نافذة النشر الفخمة مثل إنستغرام */
.instagram-box {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    transition: border-color 0.3s;
}

.instagram-box:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.instagram-box textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    background: transparent;
    min-height: 100px;
    color: var(--text-main);
}

.instagram-tools {
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tool-btn {
    background: #f1f5f9;
    color: var(--primary);
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: var(--primary);
    color: white;
}

.tool-btn input[type="file"] {
    display: none;
}

.file-badge {
    font-size: 0.85rem;
    color: #059669;
    background: #ecfdf5;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

.btn-submit {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    border: none;
    padding: 16px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    margin-top: 15px;
}

.categories-filter {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.cat-chip {
    background: #e2e8f0;
    color: var(--text-main);
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cat-chip:hover, .cat-chip.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.post-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    border-right: 6px solid var(--primary);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.teacher-info h4 {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 800;
}

.teacher-info span {
    font-size: 0.9rem;
    color: #1e40af;
    background: #eff6ff;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    margin-top: 4px;
}

.post-content {
    font-size: 1.12rem;
    color: #334155;
    margin-bottom: 18px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.post-media {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: #090d16;
    border-radius: 12px;
    margin-top: 12px;
}

.post-audio {
    width: 100%;
    margin-top: 12px;
    border-radius: 10px;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.contact-bar {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px dashed #cbd5e1;
    flex-wrap: wrap;
}

.btn-contact {
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.whatsapp { background: #25D366; color: white; }
.telegram { background: #0088cc; color: white; }

.search-box {
    margin-bottom: 20px;
}

.back-btn {
    background: #64748b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 25px;
    font-weight: 700;
}