/* صفحة المشاهدة - تنسيقات إضافية */
/* Watch Page - Additional Styles */

/* Scrollbar للدردشة */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #1a1b22;
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #a78bfa;
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #c4b5fd;
}

/* تأثيرات الرسائل */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

/* تأثيرات الأزرار */
.server-btn {
    position: relative;
    overflow: hidden;
}

.server-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.server-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* تأثير النبض للإشعارات */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* تحسين القوائم المنسدلة */
.group\/share:hover .absolute {
    pointer-events: auto;
}

.group\/share .absolute {
    pointer-events: none;
}

/* تأثيرات الإعجاب */
@keyframes heart-beat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
}

#like-btn:active i {
    animation: heart-beat 0.3s ease-in-out;
}

/* تحسين المشغل */
#player-container iframe,
#player-container video {
    width: 100%;
    height: 100%;
    border: none;
}

/* تأثيرات التحميل */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* تحسين الإشعارات */
.watch-notification {
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* تحسين حقل الإدخال */
#chat-messages input:focus {
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

/* تحسين الأزرار الاجتماعية */
.group\/share button:hover {
    transform: translateY(-2px);
}

/* تأثيرات الصور الرمزية */
.rounded-full {
    transition: transform 0.2s;
}

.rounded-full:hover {
    transform: scale(1.05);
}

/* تحسين البطاقات */
.bg-\[#20212B\] {
    backdrop-filter: blur(10px);
}

/* تأثيرات الظل */
.shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.shadow-2xl {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

/* تحسين الانتقالات */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* تحسين الأزرار عند التفعيل */
button:active {
    transform: scale(0.95);
}

/* تحسين النصوص */
.font-semibold {
    letter-spacing: -0.01em;
}

/* تحسين الحدود */
.border-white\/5 {
    border-color: rgba(255, 255, 255, 0.05);
}

.border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1);
}

/* تحسين الخلفيات */
.bg-\[#15161C\] {
    background-color: #15161C;
}

.bg-\[#20212B\] {
    background-color: #20212B;
}

.bg-\[#1a1b22\] {
    background-color: #1a1b22;
}

.bg-\[#2A2B36\] {
    background-color: #2A2B36;
}

/* تحسين التدرجات */
.from-purple-600 {
    --tw-gradient-from: #9333ea;
}

.to-blue-600 {
    --tw-gradient-to: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .server-btn {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
    
    #chat-messages {
        font-size: 0.875rem;
    }
    
    .watch-notification {
        right: 1rem;
        left: 1rem;
        top: 5rem;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }
}

/* Print styles */
@media print {
    .watch-notification,
    #chat-messages,
    button {
        display: none !important;
    }
}


/* تأثيرات إخفاء/إظهار الدردشة */
#chat-sidebar {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#video-section {
    transition: all 0.3s ease;
}

#watch-container {
    transition: all 0.3s ease;
}

/* زر إخفاء الدردشة */
#toggle-chat-btn {
    position: relative;
    overflow: hidden;
}

#toggle-chat-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(167, 139, 250, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

#toggle-chat-btn:hover::before {
    width: 200px;
    height: 200px;
}

#toggle-chat-btn i,
#toggle-chat-btn span {
    position: relative;
    z-index: 1;
}

/* تحسين المشغل عند توسيعه */
.lg\:col-span-3 #player-container {
    transition: all 0.3s ease;
}

/* تأثير النبض للزر */
@keyframes pulse-border {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.1);
    }
    50% {
        border-color: rgba(167, 139, 250, 0.3);
    }
}

#toggle-chat-btn:hover {
    animation: pulse-border 2s ease-in-out infinite;
}

/* Responsive - إخفاء الزر على الشاشات الصغيرة */
@media (max-width: 1023px) {
    #toggle-chat-btn {
        display: none !important;
    }
}

/* تحسين الانتقالات */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* تأثير الظهور التدريجي */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}


/* Mobile Chat Styles */
#chat-sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1023px) {
    #chat-sidebar {
        max-height: 70vh;
    }
    
    #chat-sidebar.translate-y-0 {
        transform: translateY(0) !important;
    }
    
    #chat-sidebar.translate-y-full {
        transform: translateY(100%) !important;
    }
}

/* Mobile Chat Toggle Button */
#mobile-chat-toggle {
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.4);
}

#mobile-chat-toggle:active {
    transform: scale(0.95);
}

#unread-chat-badge {
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Chat overlay for mobile */
@media (max-width: 1023px) {
    #chat-sidebar.translate-y-0::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        backdrop-filter: blur(2px);
    }
}

/* Compact Chat Messages (Instagram Style) */
#chat-messages {
    padding: 0.75rem !important;
}

#chat-messages > div {
    margin-bottom: 0.5rem !important;
}

#chat-messages > div:last-child {
    margin-bottom: 0 !important;
}

/* Smaller avatars and text for more messages visibility */
#chat-messages img,
#chat-messages .rounded-full {
    width: 1.75rem !important;
    height: 1.75rem !important;
}

#chat-messages .text-xs {
    font-size: 0.75rem !important;
}

#chat-messages .text-sm {
    font-size: 0.8125rem !important;
}

/* Compact message bubbles */
#chat-messages .px-3 {
    padding-left: 0.625rem !important;
    padding-right: 0.625rem !important;
}

#chat-messages .py-1\.5 {
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
}

/* Reduce gap between messages */
#chat-messages .gap-2 {
    gap: 0.375rem !important;
}

#chat-messages .gap-1\.5 {
    gap: 0.25rem !important;
}

/* Compact margins */
#chat-messages .mb-0\.5 {
    margin-bottom: 0.125rem !important;
}

/* Instagram-style Chat Input */
form[id^="chat-form-"] .rounded-full:focus-within {
    border-color: rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.2);
}

/* Send button styling */
form[id^="chat-form-"] button[type="submit"] {
    flex-shrink: 0;
    background: transparent;
    border: none;
    white-space: nowrap;
    line-height: 1;
}

form[id^="chat-form-"] button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Compact chat input container */
form[id^="chat-form-"] {
    margin: 0 !important;
    padding: 0 !important;
}

form[id^="chat-form-"] > div {
    min-height: 36px;
}

/* Emoji button placeholder */
span[id^="emoji-btn-placeholder-"] {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Input field */
form[id^="chat-form-"] input {
    min-width: 0;
    flex: 1 1 auto;
}
