/* ==========================================================================
   EMSISPRO - Canlı Fiyat Panosu (Price Dashboard) Stilleri
   ========================================================================== */

/* B+C Responsive System: Viewport-Based Scaling */
        :root {
            /* Dynamic base font: scales from 10px at 1366px to 16px at 1920px+ */
            --base-size: clamp(10px, calc(8px + 0.4vw), 16px);
            font-size: var(--base-size);
        }

        body {
            background-color: #000;
            color: #fff;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* Main content wrapper for zoom transform */
        .zoom-wrapper {
            transform-origin: top left;
            transition: transform 0.3s ease;
        }

        /* Carousel Container */
        .carousel-container {
            position: relative;
            width: 100%;
            overflow: hidden;
        }

        .carousel-slides {
            display: flex;
            transition: transform 0.5s ease-in-out;
        }

        .carousel-slide {
            min-width: 100%;
            display: flex;
            flex-wrap: wrap;
        }

        /* Carousel Indicators */
        .carousel-indicators {
            display: none;
            justify-content: center;
            gap: 0.6rem;
            padding: 1rem 0;
            position: fixed;
            bottom: 0.6rem;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1000;
        }

        .carousel-indicators.active {
            display: flex;
        }

        .carousel-dot {
            width: 0.75rem;
            height: 0.75rem;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.3);
            cursor: pointer;
            transition: all 0.3s;
            border: 2px solid rgba(255, 255, 255, 0.5);
        }

        .carousel-dot.active {
            background: #ffc107;
            border-color: #ffc107;
            transform: scale(1.2);
        }

        /* Carousel Mode Badge */
        .carousel-mode-badge {
            display: none;
            position: fixed;
            top: 0.6rem;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 193, 7, 0.9);
            color: #000;
            padding: 0.3rem 1rem;
            border-radius: 1.2rem;
            font-size: 0.9rem;
            font-weight: bold;
            z-index: 1001;
        }

        .carousel-mode-badge.active {
            display: block;
        }

        .price-card {
            background: #111;
            border: 1px solid #333;
            border-radius: 0.6rem;
            padding: 0.8rem 0.5rem;
            margin-bottom: 1rem;
            text-align: center;
            overflow: hidden;
        }

        .price-card h3 {
            color: #ddd;
            font-size: clamp(0.9rem, 1.5vw, 1.8rem);
            font-weight: 600;
            margin-bottom: 0.5rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .price-value-small {
            font-size: clamp(1.2rem, 2.2vw, 2.8rem);
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -1px;
            white-space: nowrap;
        }

        .price-card small.text-secondary {
            font-size: clamp(0.5rem, 0.8vw, 0.9rem);
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #888 !important;
        }

        .price-value {
            font-size: 3rem;
            font-weight: bold;
            color: #d4af37;
            /* Altın rengi */
        }

        .header {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            background: linear-gradient(to right, #000, #111, #000);
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
            position: relative;
            z-index: 100;
        }

        .header h1 {
            margin: 0;
            font-size: 1.8rem;
            font-weight: 800;
            background: linear-gradient(45deg, #fff, #888);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .header-badge {
            background: rgba(255, 193, 7, 0.15);
            color: #ffc107;
            border: 1px solid rgba(255, 193, 7, 0.3);
            padding: 0.5rem 1rem;
            border-radius: 50px;
            font-size: 0.9rem;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            backdrop-filter: blur(5px);
            transition: all 0.3s ease;
        }

        .header-badge:hover {
            background: rgba(255, 193, 7, 0.25);
            border-color: rgba(255, 193, 7, 0.5);
            transform: translateY(-1px);
        }

        .header-badge i {
            font-size: 0.8rem;
        }

        .settings-btn-group {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1000;
        }

        .layout-active .price-card {
            /* Changed from .card to .price-card to match existing class */
            cursor: move;
            border: 2px dashed #ffc107 !important;
            animation: shake 0.5s infinite alternate;
            /* Optional: adds a shake effect */
        }

        /* Disable shake for now, just border */
        body.layout-active .price-card {
            border: 2px dashed #ffc107;
            cursor: move;
        }

        /* Rename Button Styles */
        .edit-name-btn {
            display: none;
            padding: 0 5px;
            font-size: 0.8rem;
            margin-left: 8px;
            border: none;
            background: rgba(255, 255, 255, 0.1);
            color: #ffc107;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .edit-name-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            color: #fff;
        }

        body.layout-active .edit-name-btn {
            display: inline-block;
        }

        /* Hide (X) Button Styles */
        .hide-product-btn {
            display: none;
            position: absolute;
            top: -10px;
            right: -10px;
            width: 28px;
            height: 28px;
            background-color: #dc3545;
            color: white;
            border-radius: 50%;
            border: 2px solid #1a1a1a;
            font-size: 14px;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
        }

        .hide-product-btn:hover {
            background-color: #bb2d3b;
        }

        body.layout-active .hide-product-btn {
            display: flex;
        }

        /* Make parent relative for absolute positioning of button */
        .price-card {
            position: relative;
        }

        /* Delete Mode Styles */
        .delete-mode-active .table-hover>tbody>tr:hover {
            --bs-table-accent-bg: #2c0b0e;
            cursor: no-drop;
        }

        .delete-mode-active tr[data-is-custom="true"] {
            cursor: pointer;
        }

        .delete-mode-active tr[data-is-custom="true"]:hover {
            --bs-table-accent-bg: #4c1116 !important;
        }

        .row-selected-delete {
            background-color: #721c24 !important;
            border: 1px solid #f5c6cb;
        }

        #trashZone {
            display: none;
            transition: all 0.3s ease;
            cursor: pointer;
            border: 2px dashed #dc3545 !important;
        }

        #trashZone.drag-over {
            background-color: #dc3545 !important;
            transform: scale(1.05);
            box-shadow: 0 0 15px rgba(220, 53, 69, 0.5);
        }

        body.layout-active #trashZone {
            display: flex !important;
        }

        /* Upload Button Styles */
        .upload-btn {
            display: none;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            color: #ffc107;
            border: 1px dashed #ffc107;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            margin: 0 auto;
        }

        .upload-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.1);
        }

        body.layout-active .upload-btn {
            display: flex;
        }

        .product-image {
            max-height: clamp(3rem, 6vw, 7.5rem);
            max-width: clamp(4rem, 8vw, 10rem);
            object-fit: contain;
            border-radius: 0.3rem;
            transition: transform 0.3s ease;
        }

        .product-image:hover {
            transform: scale(1.5);
            z-index: 100;
            position: relative;
            background: #111;
            box-shadow: 0 0 1rem rgba(0, 0, 0, 0.8);
        }

        /* Adjustments for center image */
        .image-area {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-width: 3rem;
        }

        /* =====================================================
           CLASSIC SCREEN MODE STYLES
           ===================================================== */
        .classic-screen {
            --classic-scale: 1;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: linear-gradient(135deg, #8BC34A 0%, #7CB342 100%);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .classic-header {
            background: #C62828;
            color: white;
            padding: clamp(0.3rem, 1vh, 0.8rem) clamp(1rem, 2vw, 2rem);
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
        }

        .classic-title {
            font-size: clamp(1rem, 2.5vw, 2rem);
            font-weight: bold;
            letter-spacing: 2px;
            display: inline-flex;
            align-items: center;
            gap: 0.6em;
        }

        .classic-source-logo {
            height: 1.2em;
            width: auto;
            vertical-align: middle;
            object-fit: contain;
            transition: filter 0.3s ease;
        }

        .classic-source-logo.source-flash {
            animation: source-pulse 0.6s ease-in-out 5;
        }

        @keyframes source-pulse {
            0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
            50%      { transform: scale(1.4); filter: drop-shadow(0 0 8px #ffc107); }
        }

        .classic-datetime {
            font-size: clamp(0.8rem, 1.5vw, 1.2rem);
            opacity: 0.9;
        }

        .classic-exit-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
            transition: all 0.3s;
        }

        .classic-exit-btn:hover {
            background: rgba(255, 255, 255, 0.4);
            transform: scale(1.1);
        }

        .classic-body {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .classic-top-section {
            display: flex;
            flex: 1;
        }

        .classic-top-section .classic-table {
            flex: 0 0 60%;
        }

        .classic-carousel {
            flex: 0 0 40%;
            background: #81D4FA;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .classic-right-panel {
            flex: 0 0 40%;
            display: flex;
            flex-direction: column;
            background: #81D4FA;
            min-height: 0;
            /* Allow flex children to shrink */
        }

        .classic-right-panel .classic-carousel {
            flex: 1;
            min-height: 0;
        }

        #classicChartContainer {
            /* Sabit yükseklik (kollapse etmesin) ama viewport'a duyarlı.
               Eski 200px tek satır çalıyordu; clamp ile küçük ekranda 110px,
               büyük ekranda 160px maks — alttaki ürün satırına yer kalsın. */
            flex: 0 0 auto;
            height: clamp(110px, 18vh, 160px);
            width: 100%;
            padding: 8px 10px;
            border-top: 3px solid #dc3545;
            background: #f8f9fa;
            box-sizing: border-box;
            position: relative;          /* placeholder overlay için */
            overflow: hidden;
        }

        #classicChartContainer canvas {
            width: 100% !important;
            height: 100% !important;
            display: block;
        }

        /* Placeholder canvas üzerine overlay olsun, container'ı büyütmesin */
        #chartPlaceholder {
            position: absolute;
            inset: 10px;                 /* padding ile aynı */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #333;
            font-size: 1.2rem;
            font-weight: bold;
            text-align: center;
            background: #f8f9fa;
            pointer-events: none;
        }

        .classic-bottom-section {
            flex: 1;
        }

        .classic-table {
            width: 100%;
            height: 100%;
            border-collapse: collapse;
            table-layout: fixed;
        }

        .classic-table th,
        .classic-table td {
            border: 2px solid #1A237E;
            padding: clamp(0.3rem, 1vh, 0.8rem) clamp(0.5rem, 1vw, 1rem);
            vertical-align: middle;
        }

        .classic-table thead th {
            background: #1A237E;
            color: white;
            font-size: calc(clamp(1rem, 2vw, 1.8rem) * var(--classic-scale));
            font-weight: bold;
            text-align: center;
        }

        .classic-table .product-col {
            background: #283593;
            color: white;
            font-size: calc(clamp(1.2rem, 3vw, 2.5rem) * var(--classic-scale));
            font-weight: bold;
            width: 45%;
            text-align: left;
        }

        .classic-table .price-col {
            background: #283593;
            color: white;
            font-size: calc(clamp(1.2rem, 3vw, 2.5rem) * var(--classic-scale));
            font-weight: bold;
            text-align: center;
        }

        .classic-ticker {
            background: #1A237E;
            color: #FFEB3B;
            padding: clamp(0.3rem, 0.8vh, 0.6rem) 0;
            overflow: hidden;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .classic-ticker-content {
            display: inline-block;
            animation: ticker-scroll 30s linear infinite;
            font-size: clamp(1rem, 2vw, 1.5rem);
            font-weight: bold;
            letter-spacing: 1px;
        }

        @keyframes ticker-scroll {
            0% {
                transform: translateX(100%);
            }

            100% {
                transform: translateX(-100%);
            }
        }

        .carousel-item-classic {
            text-align: center;
        }

        .carousel-item-classic img {
            max-height: 15vh;
            max-width: 80%;
            object-fit: contain;
            margin-bottom: 0.5rem;
        }

        .carousel-item-classic .carousel-name {
            font-size: clamp(1rem, 2vw, 1.5rem);
            font-weight: bold;
            color: #1A237E;
            margin-bottom: 0.3rem;
        }

        .carousel-item-classic .carousel-price {
            font-size: clamp(1.5rem, 3.5vw, 2.5rem);
            font-weight: bold;
            color: #C62828;
        }

        .classic-settings-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
            transition: all 0.3s;
        }

        .classic-settings-btn:hover {
            background: rgba(255, 255, 255, 0.4);
            transform: rotate(90deg);
        }

        /* Settings modal should appear above classic screen */
        #classicSettingsModal {
            z-index: 10001 !important;
        }

        /* Template Slots Styling */
        .template-slots-grid {
            margin-top: 1rem;
        }

        .template-slot {
            position: relative;
            border: 2px solid #495057;
            border-radius: 0.5rem;
            padding: 1rem;
            background-color: #1e1e1e;
            min-height: 80px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
        }

        .template-slot:hover {
            border-color: #ffc107;
            background-color: #2a2a2a;
        }

        .template-slot.empty {
            border-style: dashed;
            color: #6c757d;
        }

        .template-slot.filled {
            border-color: #0d6efd;
            background-color: #0d2637;
        }

        .template-slot.filled:hover {
            border-color: #ffc107;
        }

        .template-slot.active {
            border-color: #ffc107;
            background-color: #332701;
            box-shadow: 0 0 0.5rem rgba(255, 193, 7, 0.5);
        }

        .slot-icon {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .slot-name {
            font-size: 0.9rem;
            font-weight: 500;
            margin-bottom: 0.5rem;
        }

        .slot-actions {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            display: none;
            gap: 0.25rem;
        }

        .template-slot.filled:hover .slot-actions {
            display: flex;
        }

        .slot-delete-btn {
            background: none;
            border: none;
            color: #dc3545;
            cursor: pointer;
            padding: 0.25rem;
            font-size: 0.9rem;
        }

        .slot-delete-btn:hover {
            color: #ff6b6b;
        }

        .icon-grid {
            max-height: 200px;
            overflow-y: auto;
        }

        .icon-option {
            padding: 0.5rem;
            border: 2px solid transparent;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            background-color: #2a2a2a;
        }

        .icon-option:hover {
            border-color: #ffc107;
            background-color: #3a3a3a;
        }

        .icon-option.selected {
            border-color: #0d6efd;
            background-color: #0d2637;
        }
