/* JK File Manager - Dark Theme with Montserrat */

.jk-fm-wrap {
    font-family: 'Montserrat', sans-serif;
    background: #000000;
    color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    max-width: 1000px;
    margin: 20px auto;
    box-sizing: border-box;
}

.jk-fm-wrap *,
.jk-fm-wrap *::before,
.jk-fm-wrap *::after {
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

/* Headings */
.jk-fm-wrap h2 {
    color: #ffffff;
    font-weight: 700;
    font-size: 24px;
    margin: 0 0 24px 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Upload Form */
.jk-fm-upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.jk-fm-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jk-fm-field label {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Drop zone */
.jk-fm-dropzone {
    border: 2px dashed #555;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #111111;
    position: relative;
}

.jk-fm-dropzone:hover,
.jk-fm-dropzone.dragover {
    border-color: #3b82f6;
    background: #0a1628;
}

.jk-fm-dropzone-text {
    color: #aaaaaa;
    font-size: 16px;
    font-weight: 500;
}

.jk-fm-dropzone-text span {
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
}

.jk-fm-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* File list preview */
.jk-fm-file-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.jk-fm-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
}

.jk-fm-file-item .file-name {
    color: #ffffff;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}

.jk-fm-file-item .file-size {
    color: #888888;
    font-size: 12px;
    white-space: nowrap;
}

.jk-fm-file-item .file-remove {
    color: #ef4444;
    cursor: pointer;
    margin-left: 12px;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    border: none;
    background: none;
    padding: 0;
}

.jk-fm-file-item .file-remove:hover {
    color: #ff6b6b;
}

/* Text/textarea inputs */
.jk-fm-wrap input[type="text"],
.jk-fm-wrap input[type="date"],
.jk-fm-wrap input[type="month"],
.jk-fm-wrap input[type="number"],
.jk-fm-wrap textarea,
.jk-fm-input {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    width: 100%;
    max-width: 400px;
}

.jk-fm-wrap input[type="text"]:focus,
.jk-fm-wrap input[type="date"]:focus,
.jk-fm-wrap input[type="month"]:focus,
.jk-fm-wrap input[type="number"]:focus,
.jk-fm-wrap textarea:focus,
.jk-fm-input:focus {
    border-color: #3b82f6;
}

.jk-fm-wrap input[type="date"]::-webkit-calendar-picker-indicator,
.jk-fm-wrap input[type="month"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.jk-fm-textarea {
    max-width: 100%;
    resize: vertical;
}

/* Select dropdown */
.jk-fm-select {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    width: 100%;
    max-width: 400px;
}

.jk-fm-select:focus {
    border-color: #3b82f6;
}

.jk-fm-select option {
    background: #111111;
    color: #ffffff;
}

/* Buttons */
.jk-fm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.jk-fm-btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.jk-fm-btn-primary:hover {
    background: #2563eb;
    color: #ffffff;
}

.jk-fm-btn-primary:disabled {
    background: #1e3a5f;
    color: #666666;
    cursor: not-allowed;
}

.jk-fm-btn-danger {
    background: #ef4444;
    color: #ffffff;
    padding: 6px 14px;
    font-size: 12px;
}

.jk-fm-btn-danger:hover {
    background: #dc2626;
}

.jk-fm-btn-small {
    padding: 6px 14px;
    font-size: 12px;
}

.jk-fm-btn-secondary {
    background: #333333;
    color: #ffffff;
    padding: 6px 14px;
    font-size: 12px;
}

.jk-fm-btn-secondary:hover {
    background: #444444;
    color: #ffffff;
}

/* Progress bar */
.jk-fm-progress {
    display: none;
    margin-top: 12px;
}

.jk-fm-progress-bar {
    background: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    height: 8px;
}

.jk-fm-progress-fill {
    background: #3b82f6;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.jk-fm-progress-text {
    color: #888888;
    font-size: 12px;
    margin-top: 6px;
    text-align: center;
}

/* Messages */
.jk-fm-message {
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    display: none;
}

.jk-fm-message.success {
    background: #052e16;
    color: #4ade80;
    border: 1px solid #166534;
}

.jk-fm-message.error {
    background: #2d0a0a;
    color: #f87171;
    border: 1px solid #7f1d1d;
}

/* ---- File Browser ---- */
.jk-fm-filter {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.jk-fm-filter .jk-fm-field {
    flex: 0 0 auto;
}

/* Results info */
.jk-fm-results-info {
    color: #888888;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Pagination */
.jk-fm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0 8px;
}

.jk-fm-page-info {
    color: #aaaaaa;
    font-size: 14px;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
}

.jk-fm-pagination .jk-fm-btn {
    padding: 10px 22px;
    font-size: 13px;
}

.jk-fm-pagination .jk-fm-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Table */
.jk-fm-table-wrap {
    overflow-x: auto;
}

.jk-fm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.jk-fm-table thead th {
    background: #111111;
    color: #aaaaaa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #333333;
    white-space: nowrap;
}

.jk-fm-table tbody tr {
    border-bottom: 1px solid #1a1a1a;
    transition: background 0.2s ease;
}

.jk-fm-table tbody tr:hover {
    background: #111111;
}

.jk-fm-table tbody td {
    padding: 12px 16px;
    color: #ffffff;
    vertical-align: middle;
}

.jk-fm-table .col-name {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jk-fm-table .col-date {
    white-space: nowrap;
}

.jk-fm-table .col-size {
    white-space: nowrap;
    color: #888888;
}

.jk-fm-table .col-actions {
    white-space: nowrap;
}

.jk-fm-table .col-actions .jk-fm-btn {
    margin-right: 4px;
    margin-bottom: 4px;
}

.jk-fm-table .col-name:has(.jk-fm-rename-wrap) {
    max-width: none;
    overflow: visible;
    white-space: normal;
}

.jk-fm-table .col-actions:has(.jk-fm-rename-save) {
    white-space: normal;
}

/* Empty state */
.jk-fm-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666666;
    font-size: 16px;
}

/* Rename inline */
.jk-fm-rename-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.jk-fm-rename-wrap input[type="text"],
.jk-fm-rename-wrap input[type="date"] {
    background: #111111;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 6px 10px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    outline: none;
    width: 200px;
    max-width: 200px;
}

.jk-fm-rename-wrap input[type="date"] {
    width: 160px;
    max-width: 160px;
}

.jk-fm-rename-wrap input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Confirm modal */
.jk-fm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.jk-fm-modal-overlay.active {
    display: flex;
}

.jk-fm-modal {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.jk-fm-modal h3 {
    color: #ffffff;
    font-size: 18px;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.jk-fm-modal p {
    color: #aaaaaa;
    font-size: 14px;
    margin: 0 0 24px 0;
}

.jk-fm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Loading spinner */
.jk-fm-loading {
    text-align: center;
    padding: 30px;
    color: #888888;
    font-size: 14px;
}

.jk-fm-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #333333;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: jk-spin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes jk-spin {
    to { transform: rotate(360deg); }
}

/* ================================================
   KRATOM BUTTONS
   ================================================ */
.jk-kratom-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.jk-kratom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 160px;
}

.jk-kratom-btn-green {
    background: #16a34a;
    color: #ffffff;
    border: 2px solid #15803d;
}

.jk-kratom-btn-green:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

.jk-kratom-btn-red {
    background: #dc2626;
    color: #ffffff;
    border: 2px solid #b91c1c;
}

.jk-kratom-btn-red:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.jk-kratom-btn-white {
    background: #f8fafc;
    color: #1e1e1e;
    border: 2px solid #cbd5e1;
}

.jk-kratom-btn-white:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Active button state (category selected) */
.jk-kratom-btn-active {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
}

.jk-kratom-btn-green.jk-kratom-btn-active {
    background: #15803d;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.6), 0 4px 12px rgba(22, 163, 74, 0.4);
}

.jk-kratom-btn-red.jk-kratom-btn-active {
    background: #b91c1c;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.6), 0 4px 12px rgba(220, 38, 38, 0.4);
}

.jk-kratom-btn-white.jk-kratom-btn-active {
    background: #e2e8f0;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.6), 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* ================================================
   KRATOM FORM
   ================================================ */
.jk-kratom-form-wrap {
    max-width: 680px;
}

.jk-kratom-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.jk-kratom-form .jk-fm-field label {
    font-size: 13px;
}

.jk-kratom-product-detail {
    margin-top: 8px;
    padding: 10px 14px;
    background: #111111;
    border: 1px solid #333;
    border-radius: 8px;
}

.jk-kratom-stock-info {
    color: #4ade80;
    font-size: 13px;
    margin: 0;
    padding: 8px 12px;
    background: #052e16;
    border-radius: 6px;
    border: 1px solid #166534;
}

.jk-kratom-detail-line {
    color: #aaaaaa;
    font-size: 12px;
    margin: 6px 0 0 0;
}

.jk-kratom-detail-line strong {
    color: #ffffff;
}

.jk-kratom-info-box {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    color: #888888;
    font-size: 13px;
    font-style: italic;
}

.jk-kratom-pdf-result {
    background: #052e16;
    border: 1px solid #166534;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 8px;
}

.jk-kratom-pdf-result p {
    color: #4ade80;
    margin: 0 0 12px 0;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .jk-fm-wrap {
        padding: 16px;
        margin: 10px;
        border-radius: 8px;
    }

    .jk-fm-wrap h2 {
        font-size: 18px;
    }

    .jk-fm-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .jk-fm-wrap input[type="date"],
    .jk-fm-select,
    .jk-fm-input {
        max-width: 100%;
    }

    .jk-fm-table thead {
        display: none;
    }

    .jk-fm-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 14px 0;
        border-bottom: 1px solid #222;
    }

    .jk-fm-table tbody td {
        padding: 4px 0;
    }

    .jk-fm-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #888;
        font-size: 11px;
        text-transform: uppercase;
        display: block;
        margin-bottom: 2px;
    }

    .jk-fm-table .col-name {
        max-width: 100%;
    }

    .jk-kratom-buttons {
        flex-direction: column;
    }

    .jk-kratom-btn {
        width: 100%;
    }

    .jk-fm-pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
}
