/* ========================================================
   BotSec Cloud - Modern Application Stylesheet
   ======================================================== */

:root {
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --card-hover-border: #0d6efd;
    --transition-speed: 0.2s;
}

body {
    min-height: 100vh;
    font-family: var(--bs-font-sans-serif);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(140, 140, 140, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 140, 140, 0.6);
}

/* ========================================================
   Navbar & Brand
   ======================================================== */
.brand-text {
    letter-spacing: -0.3px;
}

/* ========================================================
   Grid / Icon View Cards
   ======================================================== */
.file-card {
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
    border-radius: 12px;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    border-color: rgba(13, 110, 253, 0.4) !important;
}

.file-card-preview {
    height: 120px;
    overflow: hidden;
    position: relative;
    user-select: none;
}

.grid-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.file-card:hover .grid-thumbnail {
    transform: scale(1.04);
}

.file-grid-icon {
    font-size: 3.2rem;
    transition: transform 0.2s ease;
}

.file-card:hover .file-grid-icon {
    transform: scale(1.08);
}

.file-name-heading {
    font-size: 0.88rem;
}

/* ========================================================
   List View Table
   ======================================================== */
#fileTable tbody tr {
    transition: background-color 0.15s ease;
}

#fileTable tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* ========================================================
   Dropzone Customization
   ======================================================== */
.dropzone {
    border-radius: 12px !important;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone:hover {
    border-color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.03) !important;
}

[data-bs-theme="dark"] .dropzone {
    border-color: #475569 !important;
    background-color: #1e293b !important;
}

[data-bs-theme="dark"] .dropzone:hover {
    border-color: #38bdf8 !important;
}

/* ========================================================
   Code Editor (Ace) in Preview Modal
   ======================================================== */
#aceEditorContainer {
    width: 100%;
    height: 65vh;
    font-size: 14px;
}

/* ========================================================
   Media Player Container
   ======================================================== */
.media-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 400px;
}

.media-preview-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.media-preview-container video {
    max-width: 100%;
    max-height: 70vh;
}

/* View toggle active state */
.view-toggle-btn.active {
    background-color: #0d6efd !important;
    color: #fff !important;
}

/* ========================================================
   Floating Context Menu (Right Click)
   ======================================================== */
.botsec-context-menu {
    position: fixed;
    z-index: 1150;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 10px;
    min-width: 205px;
    padding: 6px 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

[data-bs-theme="dark"] .botsec-context-menu {
    background-color: rgba(30, 41, 59, 0.96);
    border-color: #334155;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6) !important;
}

[data-bs-theme="light"] .botsec-context-menu {
    background-color: rgba(255, 255, 255, 0.97);
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
}

.botsec-context-menu .ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 0.88rem;
    color: var(--bs-body-color);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.botsec-context-menu .ctx-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--bs-primary);
}

[data-bs-theme="dark"] .botsec-context-menu .ctx-item:hover {
    background-color: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.botsec-context-menu .ctx-item.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.botsec-context-menu .ctx-divider {
    height: 1px;
    margin: 4px 0;
    background-color: var(--bs-border-color);
}

/* ========================================================
   Compact Toast Notification (Bottom-Right)
   ======================================================== */
#botsecToast {
    min-width: 260px;
    max-width: 400px;
    border-radius: 12px;
    font-size: 0.88rem;
}

[data-bs-theme="dark"] #botsecToast {
    background-color: #1e293b;
    border: 1px solid #334155 !important;
    color: #f8fafc;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="light"] #botsecToast {
    background-color: #ffffff;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
}
