/* ================================================================
   ملف CSS المتقدم - غرفة التحكم VIP
   تصميم عصري، واسع، مع كروت احترافية
   ================================================================ */

/* ====== إعادة تعيين عامة ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Arial, sans-serif;
    background: #0a0a0a;
    color: #eee;
    min-height: 100vh;
    direction: rtl;
}

/* ====== الحاوية الرئيسية ====== */
.app-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ====== الهيدر الرئيسي ====== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    background: #1a1a1a;
    border-radius: 20px;
    margin: 15px 0 20px;
    border: 1px solid #2a2a2a;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.main-header .logo {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #f97316, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.main-header .logo span {
    -webkit-text-fill-color: #888;
    font-size: 14px;
    font-weight: 400;
}

.main-header nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.main-header nav a {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.main-header nav a:hover {
    color: #fff;
    background: rgba(249, 115, 22, 0.15);
    transform: translateY(-2px);
}

.main-header nav a.active {
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ef4444);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

/* ====== القائمة المنسدلة للمستخدم ====== */
.user-menu {
    position: relative;
    z-index: 1000;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    padding: 4px 16px 4px 20px;
    border-radius: 40px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}

.user-menu-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: #f97316;
    transform: translateY(-2px);
}

.user-menu-btn .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f97316;
}

.user-menu-btn .name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.user-menu-btn .icon {
    color: #888;
    font-size: 12px;
    transition: transform 0.3s;
}

.user-menu-btn:hover .icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 55px;
    left: 0;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    width: 280px;
    display: none;
    overflow: hidden;
    border: 1px solid #333;
    backdrop-filter: blur(10px);
}

.dropdown-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 20px;
    background: #0a0a0a;
    text-align: center;
    border-bottom: 1px solid #333;
}

.dropdown-header img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid #f97316;
}

.dropdown-header .dname {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.dropdown-header .demail {
    color: #888;
    font-size: 13px;
    margin-top: 4px;
}

.dropdown-header .dbadge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
}

.dropdown-header .dexpiry {
    color: #888;
    font-size: 11px;
    margin-top: 6px;
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #333, transparent);
    margin: 6px 0;
}

.dropdown-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #2a2a2a;
    color: #f97316;
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: #2a1a1a;
    color: #ef4444;
}

/* ====== الكروت العامة ====== */
.card {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #2a2a2a;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.card:hover {
    border-color: #f97316;
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.1);
}

.card-title {
    color: #f97316;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ====== حاويات المحتوى ====== */
.app-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 100px);
    background: transparent;
}

/* ====== الكاميرا ====== */
.camera-section {
    flex: 1;
    position: relative;
    background: #0a0a0a;
    border-radius: 24px;
    overflow: hidden;
    min-width: 0;
    border: 1px solid #2a2a2a;
    aspect-ratio: 9 / 16;
    max-height: 80vh;
}

.camera-section video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.camera-section .camera-overlay {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 25px;
    align-items: center;
    z-index: 10;
}

.camera-section .capture-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ef4444);
    border: 3px solid #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 0 40px rgba(249, 115, 22, 0.4);
}

.camera-section .capture-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 60px rgba(249, 115, 22, 0.6);
}

.camera-section .capture-btn:active {
    transform: scale(0.95);
}

.camera-section .switch-cam-btn,
.camera-section .flash-btn,
.camera-section .live-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.camera-section .switch-cam-btn:hover,
.camera-section .flash-btn:hover,
.camera-section .live-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.camera-section .live-btn.active {
    background: #ef4444;
    border-color: #ef4444;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.camera-section .top-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.camera-section .top-controls button {
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.camera-section .top-controls button:hover {
    background: rgba(255,0,0,0.6);
}

.camera-section .scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.02) 2px,
        rgba(255,255,255,0.02) 4px);
    pointer-events: none;
    z-index: 5;
}

/* ====== الشات الجانبي ====== */
.chat-sidebar {
    width: 420px;
    background: #1a1a1a;
    border-radius: 24px;
    border: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    max-height: 80vh;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.chat-sidebar .header {
    padding: 15px 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f0f0f;
}

.chat-sidebar .header h2 {
    font-size: 18px;
    color: #f97316;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-sidebar .header .actions {
    display: flex;
    gap: 8px;
}

.chat-sidebar .header .actions button {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 30px;
}

.chat-sidebar .header .actions button:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.chat-sidebar .search-box {
    padding: 10px 20px;
    border-bottom: 1px solid #2a2a2a;
}

.chat-sidebar .search-box input {
    width: 100%;
    padding: 10px 18px;
    border-radius: 30px;
    border: 1px solid #333;
    background: #0a0a0a;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-sidebar .search-box input:focus {
    border-color: #f97316;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.05);
}

.friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
}

.friends-list::-webkit-scrollbar {
    width: 4px;
}

.friends-list::-webkit-scrollbar-track {
    background: transparent;
}

.friends-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

.friends-list::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #1a1a1a;
    color: #eee;
}

.friend-item:hover {
    background: #2a2a2a;
    padding-right: 24px;
}

.friend-item .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 0.3s;
}

.friend-item .avatar.online {
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
}

.friend-item .info {
    flex: 1;
    min-width: 0;
}

.friend-item .info .name {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.friend-item .info .status {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.friend-item .info .status.online {
    color: #4ade80;
}

.friend-item .unread-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 30px;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

/* ====== الستوري ====== */
.stories-section {
    padding: 10px 20px;
    border-bottom: 1px solid #2a2a2a;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 12px;
    background: #0f0f0f;
}

.stories-section::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: inline-block;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.story-item:hover {
    transform: scale(1.05);
}

.story-item .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f97316;
    padding: 2px;
    transition: border-color 0.3s;
}

.story-item .avatar.viewed {
    border-color: #555;
    opacity: 0.6;
}

.story-item .name {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    display: block;
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-item .name.highlight {
    color: #f97316;
}

/* ====== صفحة القفل VIP ====== */
.vip-lock {
    max-width: 500px;
    margin: 80px auto;
    background: #1a1a1a;
    padding: 50px 40px;
    border-radius: 30px;
    border: 2px solid #ef4444;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.vip-lock h1 {
    color: #f97316;
    font-size: 32px;
}

.vip-lock .lock-icon {
    font-size: 70px;
    margin: 20px 0;
}

.vip-lock .sub {
    color: #888;
    margin: 15px 0;
    font-size: 16px;
}

.vip-lock .btn {
    display: inline-block;
    padding: 12px 35px;
    border-radius: 40px;
    color: #fff;
    text-decoration: none;
    margin: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.vip-lock .btn-primary {
    background: linear-gradient(135deg, #f97316, #ef4444);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
}

.vip-lock .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.5);
}

.vip-lock .btn-secondary {
    background: #333;
}

.vip-lock .btn-secondary:hover {
    background: #444;
}

.vip-lock .btn-success {
    background: #4ade80;
    color: #000;
}

.vip-lock .btn-success:hover {
    background: #22c55e;
    transform: translateY(-2px);
}

/* ====== أزرار التفاعل العامة ====== */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 40px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.5);
}

.btn-secondary {
    background: #333;
    color: #fff;
}

.btn-secondary:hover {
    background: #444;
}

.btn-success {
    background: #4ade80;
    color: #000;
}
.heart-btn {
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,0,0,0.2); border: 2px solid #ef4444;
    cursor: pointer; font-size: 24px; color: #ef4444;
    transition: all 0.3s; display: flex; align-items: center; justify-content: center;
}
.heart-btn:hover { background: #ef4444; color: #fff; transform: scale(1.1); }

.btn-success:hover {
    background: #22c55e;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* ====== استجابة للشاشات ====== */
@media (max-width: 1200px) {
    .chat-sidebar {
        width: 360px;
    }
}

@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
        min-height: auto;
    }

    .camera-section {
        aspect-ratio: 9 / 16;
        max-height: 60vh;
        width: 100%;
    }

    .chat-sidebar {
        width: 100%;
        max-height: 50vh;
        border-radius: 20px;
    }

    .main-header {
        padding: 10px 20px;
        border-radius: 16px;
        margin: 10px 0 15px;
    }

    .main-header .logo {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 15px;
    }

    .main-header nav {
        justify-content: center;
        gap: 5px;
    }

    .main-header nav a {
        font-size: 12px;
        padding: 6px 12px;
    }

    .user-menu-btn .name {
        display: none;
    }

    .camera-section .capture-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .camera-section .switch-cam-btn,
    .camera-section .flash-btn,
    .camera-section .live-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .chat-sidebar {
        max-height: 45vh;
    }

    .chat-sidebar .header h2 {
        font-size: 15px;
    }

    .friend-item {
        padding: 8px 14px;
    }

    .friend-item .avatar {
        width: 40px;
        height: 40px;
    }

    .stories-section {
        padding: 8px 14px;
    }

    .story-item .avatar {
        width: 50px;
        height: 50px;
    }

    .vip-lock {
        padding: 30px 20px;
        margin: 40px 15px;
    }

    .vip-lock h1 {
        font-size: 26px;
    }

    .dropdown-menu {
        width: 240px;
        left: -50px;
    }
}

@media (max-width: 480px) {
    .app-wrapper {
        padding: 0 8px;
    }

    .main-header {
        padding: 8px 10px;
        border-radius: 12px;
    }

    .main-header .logo {
        font-size: 18px;
    }

    .main-header nav a {
        font-size: 11px;
        padding: 4px 8px;
    }

    .camera-section {
        border-radius: 16px;
    }

    .camera-section .camera-overlay {
        gap: 15px;
        bottom: 20px;
    }

    .camera-section .capture-btn {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }

    .camera-section .switch-cam-btn,
    .camera-section .flash-btn,
    .camera-section .live-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .chat-sidebar {
        border-radius: 16px;
    }

    .chat-sidebar .header {
        padding: 10px 14px;
    }

    .chat-sidebar .header h2 {
        font-size: 14px;
    }

    .chat-sidebar .search-box {
        padding: 8px 14px;
    }

    .chat-sidebar .search-box input {
        font-size: 12px;
        padding: 8px 14px;
    }

    .friend-item .info .name {
        font-size: 13px;
    }

    .story-item .avatar {
        width: 44px;
        height: 44px;
    }

    .vip-lock {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .vip-lock h1 {
        font-size: 22px;
    }

    .vip-lock .lock-icon {
        font-size: 50px;
    }

    .vip-lock .btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .dropdown-menu {
        width: 200px;
        left: -30px;
    }
}

/* ====== رسوم متحركة إضافية ====== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* ====== التمرير الجميل ====== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}