/* ======================= 
    RAZ Creative Studio CSV Tool - Custom Styles
======================= */

/* Mengatur font default - Poppins untuk konsistensi dengan web utama */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #121212;
    /* Dark background matching main site */
    color: #f0f0f0;
}

/* Container utama */
.main-container {
    background-color: #1e1e1e;
    /* Dark secondary */
    border: 1px solid #FFD700;
    /* Gold border */
}

/* Style untuk output yang lebih baik */
#htmlOutput {
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 100px;
    background-color: #2d2d2d;
    color: #f0f0f0;
    border-color: #FFD700;
}

/* Styling untuk tabel hasil */
#tableResult table {
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(255, 215, 0, 0.1), 0 2px 4px -2px rgba(255, 215, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
    width: auto;
    min-width: fit-content;
}

#tableResult th,
#tableResult td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

#tableResult th {
    background-color: #FFD700;
    /* Gold headers by default */
    color: #121212;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
}

#tableResult tr:hover td {
    background-color: #f3f4f6;
}

/* Align kanan untuk kolom mata uang */
.currency {
    text-align: right !important;
    font-family: monospace;
}

/* Container untuk scrolling */
.table-container {
    width: 100%;
    max-height: 400px;
    min-height: 50px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(255, 215, 0, 0.1), 0 2px 4px -2px rgba(255, 215, 0, 0.1);
}

/* Gaya scrollbar untuk WebKit browsers (Chrome, Safari, Edge) */
.table-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.table-container::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 6px;
    border: 1px solid #444;
}

.table-container::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 6px;
    border: 2px solid #2d2d2d;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #e6c500;
}

/* MEDIA QUERY KHUSUS UNTUK CETAK */
@media print {
    body>*:not(.print-container) {
        display: none;
    }

    .print-container {
        display: block !important;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .print-container .table-container {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none;
    }

    .print-container table {
        box-shadow: none;
        border: 1px solid black;
        width: auto !important;
        min-width: auto !important;
    }

    .print-container th,
    .print-container td {
        border: 1px solid black;
        border-bottom: 1px solid black !important;
        white-space: normal !important;
        word-break: break-word;
    }

    .print-container th {
        background-color: #ccc !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ======================= 
   TEMA TABEL - Text colors follow theme backgrounds
======================= */

/* Modern Theme - Gold header, light background */
.theme-modern th {
    background-color: #FFD700;
    color: #121212;
}

.theme-modern td {
    border-bottom: 1px solid #e5e7eb;
    color: #333;
    /* Dark text for light background */
}

.theme-modern tr:hover td {
    background-color: #f3f4f6;
}

/* Classic Theme - Dark header, light background */
.theme-classic th {
    background-color: #2c3e50;
    color: white;
}

.theme-classic td {
    border-bottom: 1px solid #bdc3c7;
    color: #333;
    /* Dark text for light background */
}

.theme-classic tr:hover td {
    background-color: #ecf0f1;
}

/* Minimal Theme - White header, light background */
.theme-minimal th {
    background-color: white;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.theme-minimal td {
    border-bottom: 1px solid #dee2e6;
    color: #333;
    /* Dark text for light background */
}

.theme-minimal tr:hover td {
    background-color: #f8f9fa;
}

/* Dark Theme - Dark background */
.theme-dark {
    background-color: #1a202c;
    color: white;
}

.theme-dark th {
    background-color: #2d3748;
    color: white;
}

.theme-dark td {
    border-bottom: 1px solid #4a5568;
    color: white;
    /* White text for dark background */
}

.theme-dark tr:hover td {
    background-color: #4a5568;
}

/* Blue Theme - Blue header, light background */
.theme-blue th {
    background-color: #3b82f6;
    color: white;
}

.theme-blue td {
    border-bottom: 1px solid #93c5fd;
    color: #333;
    /* Dark text for light background */
}

.theme-blue tr:hover td {
    background-color: #dbeafe;
}

/* Green Theme - Green header, light background */
.theme-green th {
    background-color: #10b981;
    color: white;
}

.theme-green td {
    border-bottom: 1px solid #6ee7b7;
    color: #333;
    /* Dark text for light background */
}

.theme-green tr:hover td {
    background-color: #d1fae5;
}

/* Purple Theme - Purple header, light background */
.theme-purple th {
    background-color: #8b5cf6;
    color: white;
}

.theme-purple td {
    border-bottom: 1px solid #c4b5fd;
    color: #333;
    /* Dark text for light background */
}

.theme-purple tr:hover td {
    background-color: #ede9fe;
}

/* Red Theme - Red header, light background */
.theme-red th {
    background-color: #ef4444;
    color: white;
}

.theme-red td {
    border-bottom: 1px solid #fca5a5;
    color: #333;
    /* Dark text for light background */
}

.theme-red tr:hover td {
    background-color: #fee2e2;
}

/* Orange Theme - Orange header, light background */
.theme-orange th {
    background-color: #f97316;
    color: white;
}

.theme-orange td {
    border-bottom: 1px solid #fdba74;
    color: #333;
    /* Dark text for light background */
}

.theme-orange tr:hover td {
    background-color: #ffedd5;
}

/* Teal Theme - Teal header, light background */
.theme-teal th {
    background-color: #0d9488;
    color: white;
}

.theme-teal td {
    border-bottom: 1px solid #5eead4;
    color: #333;
    /* Dark text for light background */
}

.theme-teal tr:hover td {
    background-color: #ccfbf1;
}

/* Custom Popup Styles */
#customPopup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
    max-width: 350px;
}

#customPopup.show {
    opacity: 1;
    transform: translateX(0);
}

#customPopup.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

#customPopup.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

#customPopup.info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

#popupClose {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    padding: 2px;
}

/* Labels dan text styling untuk dark mode */
.text-label {
    color: #FFD700;
}

.text-secondary {
    color: #aaaaaa;
}

/* Input styling untuk dark mode */
textarea,
input[type="number"] {
    background-color: #2d2d2d;
    color: #f0f0f0;
    border-color: #444;
}

textarea:focus,
input[type="number"]:focus {
    border-color: #FFD700;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

/* Editor panel dark styling */
#editorPanel {
    background-color: #2d2d2d;
    border-color: #FFD700;
}

#editorPanel h3 {
    color: #FFD700;
}

#editorPanel h4 {
    color: #f0f0f0;
}