/* gold-popup-chart.css - Popup Gold Chart Styles */

/* === ANIMÁCIE === */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* === HLAVNÝ CONTAINER MALÉHO GRAFU === */
.gold-popup-chart-container {
    max-width: 100%;
    width: 100%;
    margin: 20px auto;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

/* === OVLÁDANIE MALÉHO GRAFU === */
.gold-popup-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #333;
    gap: 15px;
}

.period-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-buttons button {
    background: #222;
    color: #d4af37;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    min-width: 50px;
}

.period-buttons button:hover {
    background: #333;
    border-color: #d4af37;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.period-buttons button.active {
    background: #d4af37;
    color: #1a1a1a;
    border-color: #d4af37;
    font-weight: bold;
}

.period-buttons button:active {
    transform: translateY(0);
}

/* Fullscreen tlačidlo */
.fullscreen-btn {
    background: linear-gradient(135deg, #d4af37, #f4d03f);
    color: #1a1a1a;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.fullscreen-btn:hover {
    background: linear-gradient(135deg, #f4d03f, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.6);
}

.fullscreen-btn:active {
    transform: translateY(0);
}

/* === MALÝ GRAF === */
.small-chart {
    position: relative;
    background: #0a0a0a;
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
    width: 100%;
    height: 300px; /* Fixná výška */
    min-height: 300px;
}

.small-chart .loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d4af37;
    font-size: 16px;
    font-weight: bold;
    z-index: 10;
}

/* LightweightCharts container v malom grafe */
.small-chart > div {
    width: 100% !important;
    height: 100% !important;
}

.small-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* === INFO PANEL === */
.chart-info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 12px 0;
    border-top: 1px solid #333;
    color: #d4af37;
}

.current-price {
    font-size: 24px;
    font-weight: bold;
    color: #d4af37;
}

.last-update {
    font-size: 12px;
    color: #888;
}

/* === POPUP OVERLAY === */
.popup-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999 !important;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.show {
    opacity: 1;
}

/* === POPUP CONTAINER === */
.popup-container {
    width: 95vw;
    height: 90vh;
    max-width: none;
    background: #1a1a1a;
    border-radius: 12px;
    border: 2px solid #d4af37;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    animation: popupSlideIn 0.3s ease;
}

/* === POPUP HEADER === */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #333, #2a2a2a);
    border-bottom: 2px solid #d4af37;
}

.popup-header h3 {
    color: #d4af37;
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.popup-close-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popup-close-btn img {
    max-width: 100px;
    width: 100px;
}
.popup-close-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* === POPUP OVLÁDANIE === */
.popup-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #222;
    border-bottom: 1px solid #444;
    gap: 20px;
}

.popup-controls .period-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.popup-controls .period-buttons button {
    padding: 10px 18px;
    font-size: 15px;
}

.popup-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.popup-price {
    font-size: 28px;
    font-weight: bold;
    color: #d4af37;
}

.popup-update {
    font-size: 13px;
    color: #888;
}


/* === VEĽKÝ GRAF - DESKTOP OPRAVA === */
.full-chart {
    flex: 1;
    position: relative;
    background: #0a0a0a;
    overflow: hidden;
    width: 100%;
    min-height: 0;
    padding: 0; /* PRIDAJ TOTO */
    margin: 0;  /* PRIDAJ TOTO */
}

/* LightweightCharts v popup - OPRAVA */
.full-chart > div {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;  /* PRIDAJ TOTO */
    bottom: 0 !important; /* PRIDAJ TOTO */
}

.full-chart .loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d4af37;
    font-size: 20px;
    font-weight: bold;
    z-index: 10;
}

/* === POPUP FOOTER === */
.popup-footer {
    padding: 10px 20px;
    background: #333;
    border-top: 1px solid #555;
    text-align: center;
}

.popup-footer small {
    color: #888;
    font-size: 12px;
}

/* === RESPONZÍVNY DIZAJN === */

/* Tablet */
@media (max-width: 1024px) {
    .gold-popup-chart-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .gold-popup-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .fullscreen-btn {
        width: 100%;
        padding: 12px;
    }
    
    .popup-container {
        width: 98vw;
        height: 95vh;
    }
    
    .popup-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .popup-info {
        align-items: center;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .gold-popup-chart-container {
        padding: 12px;
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .period-buttons {
        justify-content: center;
    }
    
    .period-buttons button {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 40px;
    }
    
    .fullscreen-btn {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .current-price {
        font-size: 20px;
    }
    
    .chart-info-panel {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    /* Popup mobile */
    .popup-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .popup-header {
        padding: 12px 15px;
    }
    
    .popup-header h3 {
        font-size: 18px;
    }
    
    .popup-controls {
        padding: 12px 15px;
    }
    
    .popup-controls .period-buttons button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .popup-price {
        font-size: 22px;
    }
    
    .popup-footer {
        padding: 8px 15px;
    }
}

/* Malé mobile zariadenia */
@media (max-width: 480px) {
    .gold-popup-chart-container {
        padding: 10px;
        margin: 8px 0;
    }
    
    .period-buttons button {
        padding: 5px 10px;
        font-size: 11px;
        margin: 1px;
    }
    
    .fullscreen-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .current-price {
        font-size: 18px;
    }
    
    .popup-controls .period-buttons {
        gap: 5px;
    }
    
    .popup-controls .period-buttons button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .popup-price {
        font-size: 20px;
    }
}

/* === TOOLTIP PRE TLAČIDLÁ === */
/*
.period-buttons button[title],
.fullscreen-btn[title],
.popup-close-btn[title] {
    position: relative;
}

.period-buttons button[title]:hover::after,
.fullscreen-btn[title]:hover::after,
.popup-close-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #d4af37;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    border: 1px solid #d4af37;
}
*/

/* === DARK THEME OPTIMALIZÁCIA === */
body.dark-theme .gold-popup-chart-container,
.wp-admin .gold-popup-chart-container {
    background: #2c2c2c;
    border-color: #555;
}

body.dark-theme .period-buttons button,
.wp-admin .period-buttons button {
    background: #333;
    border-color: #555;
}

body.dark-theme .period-buttons button:hover,
.wp-admin .period-buttons button:hover {
    background: #444;
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .popup-overlay {
        transition: none;
    }
    
    .popup-container {
        animation: none;
    }
}

/* Focus states pre accessibility */
.period-buttons button:focus,
.fullscreen-btn:focus,
.popup-close-btn:focus {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .gold-popup-chart-container {
        border: 2px solid #fff;
    }
    
    .period-buttons button {
        border: 2px solid #fff;
    }
    
    .period-buttons button.active {
        background: #fff;
        color: #000;
    }
}

/* === LOADING STAVY === */
.small-chart.loading,
.full-chart.loading {
    opacity: 0.6;
    pointer-events: none;
}

.small-chart.loading::before,
.full-chart.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.small-chart.loading::after,
.full-chart.loading::after {
    content: 'Načítavam...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d4af37;
    font-weight: bold;
    z-index: 6;
}

/* === PRINT STYLES === */
@media print {
    .popup-overlay {
        position: static;
        background: white;
        color: black;
    }
    
    .popup-container {
        box-shadow: none;
        border: 1px solid black;
    }
    
    .popup-header,
    .popup-controls,
    .popup-footer {
        background: white;
        color: black;
    }
    
    .popup-close-btn,
    .period-buttons {
        display: none;
    }
}