/* =========================================
   Imports
========================================= */
@import url('./modules/variables.css');
@import url('./modules/header.css');
@import url('./modules/device-connection.css');
@import url('./modules/theme.css');
@import url('./modules/remote.css'); /* اضافه شدن استایل های ریموت کنترل */

/* =========================================
   Base Styles
========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: row;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    height: 100dvh; /* تغییر کلیدی: استفاده از dvh برای تطبیق با مرورگرهای موبایل */
    overflow: hidden;
}

/* =========================================
   TV Section & Main Player
========================================= */
.tv-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-base); /* یکپارچه شدن رنگ پس زمینه */
    padding: 0; /* حذف پدینگ برای استفاده از کل فضا */
}

.tv-wrapper {
    width: 100%;
    height: 100%; /* پر کردن کامل ارتفاع در دسکتاپ */
    background-color: var(--bg-base);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    /* حذف border، border-radius، box-shadow و max-width */
}

.tv-wrapper:fullscreen {
    max-width: 100%;
    height: 100dvh; /* تغییر به dvh در حالت تمام صفحه */
    border: none;
    border-radius: 0;
}

.tv-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
}

#main-player {
    width: 100%;
    height: 100%;
    object-fit: contain; /* در صورت تمایل به برش ویدیو برای پر کردن کامل قاب، میتوانید این را به cover تغییر دهید */
    background-color: var(--bg-base);
}

/* =========================================
   OSD System & Power LED
========================================= */
.osd {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--osd-text);
    font-size: 22px;
    font-family: monospace;
    background: var(--bg-glass);
    padding: 5px 15px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    pointer-events: none;
}

.osd.visible {
    opacity: 1;
}

.power-led {
    position: absolute;
    bottom: 10px;
    right: 15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--led-off);
    transition: all 0.3s;
}

.power-led.on {
    background-color: var(--osd-text);
    box-shadow: 0 0 8px var(--osd-text);
}

/* =========================================
   Responsive Configuration
========================================= */
@media (max-width: 800px) {
    body {
        flex-direction: column;
    }
    
    .tv-section {
        padding: 0;
        flex: unset;
        height: auto;
    }

    .tv-wrapper {
        aspect-ratio: 16 / 9; /* حفظ تناسب مستطیلی ویدیو در موبایل */
        height: auto;
    }
    
    /* عرض صد در صد برای ریموت در موبایل */
    .ig-remote {
        width: 100%;
        border-right: none;
        flex: 1;
    }
}
