/* Admin Panel Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6fa;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background: #ffffff;
    color: #262626;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.06);
    z-index: 100;
}

.sidebar-logo {
    padding: 30px 20px;
    border-bottom: 1px solid #e6e6e6;
}

.sidebar-logo h2 {
    font-size: 24px;
    font-weight: bold;
    color: #1890ff;
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
}

.nav-item {
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: #595959;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f5f5f5;
    color: #1890ff;
}

.nav-item.active {
    background: #e6f7ff;
    color: #1890ff;
    border-left-color: #1890ff;
}

.nav-icon {
    font-size: 20px;
}

/* Main Content Area */
.admin-main {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f5f6fa;
}

/* Content */
.admin-content {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

/* Categories Grid */
.categories-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
}

.category-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border: 2px solid #ddd;
}

.category-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-color: #000;
}

.category-card-header {
    background: #fafafa;
    padding: 20px;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-card-title {
    font-size: 20px;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0;
}

.category-options {
    cursor: pointer;
    font-size: 20px;
    color: #8c8c8c;
    padding: 5px;
    transition: color 0.3s;
}

.category-options:hover {
    color: #1890ff;
}

.category-card-body {
    padding: 20px;
}

.category-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

.category-product-item:last-child {
    border-bottom: none;
}

.product-name {
    color: #1a1a1a;
}

.product-price {
    color: #1890ff;
    font-weight: 600;
}

.category-card-actions {
    padding: 15px 20px;
    background: #fafafa;
    border-top: 1px solid #e6e6e6;
    display: flex;
    gap: 10px;
}

/* Sort Mode Styles */
.sort-mode .category-card {
    cursor: move;
    transition: all 0.3s ease;
}

.sort-mode .category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.drag-handle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    color: #666;
    font-size: 16px;
    font-weight: bold;
    padding: 5px;
    user-select: none;
}

.drag-handle:hover {
    color: #1890ff;
}

.drag-handle:active {
    cursor: grabbing;
}

.sort-mode .category-card-header {
    position: relative;
    padding-right: 50px;
}

/* Category Modal Styles */
.category-modal-content {
    max-width: 600px;
    width: 90%;
}

.products-section {
    margin-top: 20px;
}

.products-header {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.product-header-name,
.product-header-price {
    font-weight: 600;
    color: #000;
    font-size: 14px;
    text-transform: uppercase;
}

.products-list {
    margin-bottom: 15px;
}

.product-row {
    display: grid;
    grid-template-columns: 1fr 120px 40px;
    gap: 15px;
    margin-bottom: 10px;
    align-items: center;
}

.product-row input {
    padding: 8px 12px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.product-row input:focus {
    outline: none;
    border-color: #000;
}

.remove-product-btn {
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius:Phillip50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
}

.remove-product-btn:hover {
    background: #ff7875;
    transform: scale(1.1);
}

.btn-add-product {
    width: 100%;
    padding: 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-add-product:hover {
    background: #5a6268;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #1a1a1a;
}

.toggle-switch input[type="checkbox"] {
    position: relative;
    width: 44px;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: #d9d9d9;
    border-radius: 12px;
    outline: none;
    transition: 0.3s;
}

.toggle-switch input[type="checkbox"]:checked {
    background: #1890ff;
}

.toggle-switch input[type="checkbox"]:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: white;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input[type="checkbox"]:checked:before {
    left: 22px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* Footer */
.admin-footer {
    background: #ffffff;
    color: #8c8c8c;
    padding: 15px 40px;
    text-align: center;
    border-top: 1px solid #e6e6e6;
}

.admin-footer p {
    font-size: 14px;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.admin-header {
    background: #ffffff;
    color: #262626;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e6e6e6;
}

.admin-header .header-title h1 {
    font-size: 26px;
    font-weight: 600;
    color: #1a1a1a;
}

.admin-header .header-user {
    font-size: 16px;
    background: #1890ff;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
}

.admin-tabs {
    display: none;
}

.tab-btn {
    display: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #1a1a1a;
    font-weight: 600;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #1890ff;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #f5f5f5;
    color: #595959;
    border: 1px solid #d9d9d9;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
    border: none;
}

.btn-success {
    background: #52c41a;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #e6e6e6;
    border-color: #bfbfbf;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.media-item-actions .btn {
    flex: 1;
    font-size: 12px;
    padding: 8px 12px;
}

.list-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.list-item {
    background: #fafafa;
    padding: 15px;
    margin-bottomestimate 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid #1890ff;
    transition: all 0.3s;
}

.list-item:hover {
    background: #f0f0f0;
}

.list-item-info h3 {
    color: #1a1a1a;
    margin-bottom: 5px什么是ont-weight: 600;
}

.list-item-info p {
    color: #595959;
    font-size: 14px;
}

.list-item-actions {
    display: flex;
    gap: 10px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.media-item {
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid #e6e6e6;
}

.media-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    border-color: #1890ff;
    transform: translateY(-urope)
}

.media-item img, .media-item video {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.media-item-info {
    padding: 10px;
}

.media-item-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.status-active {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-inactive {
    background: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    color: #8c8c8c;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
    transition: color 0.3s;
}

.close:hover {
    color: #ff4d4f;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #262626;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* TV Display Styles */
.display-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
    position: relative;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
}

/* Fullscreen mode styles */
:fullscreen .display-container {
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

:-webkit-full-screen .display-container {
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

:-moz-full-screen .display-container {
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

:-ms-fullscreen .display-container {
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.display-left {
    width: 70vw;
    height: 100vh;
    background: white;
    padding: 2vh 2vw;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.display-right {
    width: 30vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    background: #000;
    min-width: 0;
    min-height: 0;
}

/* Fullscreen mode adjustments for left and right sections */
:fullscreen .display-left {
    width: 70vw !important;
    height: 100vh !important;
    padding: 2vh 2vw !important;
}

:fullscreen .display-right {
    width: 30vw !important;
    height: 100vh !important;
}

:-webkit-full-screen .display-left {
    width: 70vw !important;
    height: 100vh !important;
    padding: 2vh 2vw !important;
}

:-webkit-full-screen .display-right {
    width: 30vw !important;
    height: 100vh !important;
}

:-moz-full-screen .display-left {
    width: 70vw !important;
    height: 100vh !important;
    padding: 2vh 2vw !important;
}

:-moz-full-screen .display-right {
    width: 30vw !important;
    height: 100vh !important;
}

:-ms-fullscreen .display-left {
    width: 70vw !important;
    height: 100vh !important;
    padding: 2vh 2vw !important;
}

:-ms-fullscreen .display-right {
    width: 30vw !important;
    height: 100vh !important;
}

.display-right video,
.display-right img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    object-position: center !important;
    position: absolute;
    top: 0;
    left: 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2vh 2vw;
    margin: 0;
    padding: 0;
    width: 100%;
    align-items: start;
    grid-auto-rows: min-content;
    grid-auto-flow: row dense;
}

/* Fullscreen mode adjustments for menu grid */
:fullscreen .menu-grid {
    gap: 2vh 2vw !important;
    align-items: start !important;
    grid-auto-rows: min-content !important;
    grid-template-columns: repeat(auto-fit, minmax(20vw, 1fr)) !important;
    grid-auto-flow: row dense !important;
}

:-webkit-full-screen .menu-grid {
    gap: 2vh 2vw !important;
    align-items: start !important;
    grid-auto-rows: min-content !important;
    grid-template-columns: repeat(auto-fit, minmax(20vw, 1fr)) !important;
    grid-auto-flow: row dense !important;
}

:-moz-full-screen .menu-grid {
    gap: 2vh 2vw !important;
    align-items: start !important;
    grid-auto-rows: min-content !important;
    grid-template-columns: repeat(auto-fit, minmax(20vw, 1fr)) !important;
    grid-auto-flow: row dense !important;
}

:-ms-fullscreen .menu-grid {
    gap: 2vh 2vw !important;
    align-items: start !important;
    grid-auto-rows: min-content !important;
    grid-template-columns: repeat(auto-fit, minmax(20vw, 1fr)) !important;
    grid-auto-flow: row dense !important;
}

.menu-card {
    background: #f8f9fa;
    border-radius: 0.5vh;
    padding: 1.5vh 1.5vw;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    height: auto;
    min-height: fit-content;
}

/* Fullscreen mode adjustments for menu cards */
:fullscreen .menu-card {
    padding: 1.5vh 1.5vw !important;
    border-radius: 0.5vh !important;
    height: auto !important;
    min-height: fit-content !important;
}

:-webkit-full-screen .menu-card {
    padding: 1.5vh 1.5vw !important;
    border-radius: 0.5vh !important;
    height: auto !important;
    min-height: fit-content !important;
}

:-moz-full-screen .menu-card {
    padding: 1.5vh 1.5vw !important;
    border-radius: 0.5vh !important;
    height: auto !important;
    min-height: fit-content !important;
}

:-ms-fullscreen .menu-card {
    padding: 1.5vh 1.5vw !important;
    border-radius: 0.5vh !important;
    height: auto !important;
    min-height: fit-content !important;
}

.menu-card-header {
    background: #000;
    color: white;
    padding: 1vh;
    margin: -1.5vh -1.5vw 1vh -1.5vh;
    border-radius: 0.5vh 0.5vh 0 0;
    text-align: center;
    font-size: 1.5vh;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fullscreen mode adjustments for menu card header */
:fullscreen .menu-card-header {
    padding: 1vh !important;
    margin: -1.5vh -1.5vw 1vh -1.5vh !important;
    font-size: 1.5vh !important;
    border-radius: 0.5vh 0.5vh 0 0 !important;
}

:-webkit-full-screen .menu-card-header {
    padding: 1vh !important;
    margin: -1.5vh -1.5vw 1vh -1.5vh !important;
    font-size: 1.5vh !important;
    border-radius: 0.5vh 0.5vh 0 0 !important;
}

:-moz-full-screen .menu-card-header {
    padding: 1vh !important;
    margin: -1.5vh -1.5vw 1vh -1.5vh !important;
    font-size: 1.5vh !important;
    border-radius: 0.5vh 0.5vh 0 0 !important;
}

:-ms-fullscreen .menu-card-header {
    padding: 1vh !important;
    margin: -1.5vh -1.5vw 1vh -1.5vh !important;
    font-size: 1.5vh !important;
    border-radius: 0.5vh 0.5vh 0 0 !important;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8vh 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.4vh;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item-name {
    color: #333;
    font-size: 1.4vh;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.8vw;
}

.menu-item-price {
    color: #333;
    font-size: 1.4vh;
    font-weight: bold;
    white-space: nowrap;
}

/* Fullscreen mode adjustments for menu items */
:fullscreen .menu-item {
    padding: 0.8vh 0 !important;
    font-size: 1.4vh !important;
}

:fullscreen .menu-item-name {
    font-size: 1.4vh !important;
    margin-right: 0.8vw !important;
}

:fullscreen .menu-item-price {
    font-size: 1.4vh !important;
}

:-webkit-full-screen .menu-item {
    padding: 0.8vh 0 !important;
    font-size: 1.4vh !important;
}

:-webkit-full-screen .menu-item-name {
    font-size: 1.4vh !important;
    margin-right: 0.8vw !important;
}

:-webkit-full-screen .menu-item-price {
    font-size: 1.4vh !important;
}

:-moz-full-screen .menu-item {
    padding: 0.8vh 0 !important;
    font-size: 1.4vh !important;
}

:-moz-full-screen .menu-item-name {
    font-size: 1.4vh !important;
    margin-right: 0.8vw !important;
}

:-moz-full-screen .menu-item-price {
    font-size: 1.4vh !important;
}

:-ms-fullscreen .menu-item {
    padding: 0.8vh 0 !important;
    font-size: 1.4vh !important;
}

:-ms-fullscreen .menu-item-name {
    font-size: 1.4vh !important;
    margin-right: 0.8vw !important;
}

:-ms-fullscreen .menu-item-price {
    font-size: 1.4vh !important;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-state img {
    max-width: 200px;
    margin-bottom: 20px;
}

.display-right .empty-state {
    background: #000;
    color: #fff;
}

/* Responsive adjustments for admin */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 240px;
    }
    
    .admin-main {
        margin-left: 240px;
    }
    
    .admin-content {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Display adjustments for TV */
/* Scale is now managed by JavaScript in display.js */

/* Powered by notice */
.powered-by {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Fullscreen button */
.fullscreen-btn {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: #000000;
    color: white;
    border: 2px solid #ffffff;
    border-radius: 15px;
    padding: 20px 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.fullscreen-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8);
    background: #333333;
}

.fullscreen-btn:active {
    transform: translate(-50%, -50%) scale(0.98);
}

.fullscreen-btn svg {
    width: 24px;
    height: 24px;
}

.fullscreen-btn.hidden {
    display: none;
}

/* Record button */
.record-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    background: #ff4444;
    color: white;
    border: 2px solid #ffffff;
    border-radius: 15px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(255, 68, 68, 0.6);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.record-btn:hover {
    background: #ff6666;
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 68, 68, 0.8);
}

.record-btn:active {
    transform: scale(0.98);
}

.record-btn.recording {
    background: #ff0000;
    animation: pulse 1s infinite;
}

.record-btn svg {
    width: 20px;
    height: 20px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

