/*
================================================================
PodhraskiServer NAS Dashboard - Styling
Design Concept: Windows 11 (Glassmorphism, High-Rounding, Smooth Transitions)
================================================================
*/

/* --- CSS Theme Variables --- */
:root {
    /* Fonts */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif;
    
    /* Transition Timings */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout Tokens */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-round: 50%;
    
    /* Specific Colors (Neutral) */
    --color-files: #0078d4;
    --color-photos: #e81123;
    --color-passwords: #107c41;
    --color-settings: #5c2d91;
    --chart-line-tx: #ffaa00;

    /* Light Theme (Default) */
    --bg-primary: #f0f4f9;
    --bg-secondary: rgba(255, 255, 255, 0.65);
    --bg-glass-solid: #ffffff;
    --accent-primary: #0078d4;
    --accent-hover: #005a9e;
    --accent-light: rgba(0, 120, 212, 0.1);
    --text-primary: #1c1c1c;
    --text-secondary: #5f6368;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(31, 38, 135, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --backdrop-blur: blur(20px) saturate(180%);
    --card-glow: rgba(0, 120, 212, 0.15);
    --login-bg: radial-gradient(circle at 10% 20%, rgba(216, 241, 250, 0.46) 0.1%, rgba(233, 226, 249, 0.46) 90.1%), #f0f4f9;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #070d1e;
    --bg-secondary: rgba(14, 22, 44, 0.65);
    --bg-glass-solid: #0d1527;
    --accent-primary: #4f9cf9;
    --accent-hover: #7eb6ff;
    --accent-light: rgba(79, 156, 249, 0.15);
    --text-primary: #f5f6f8;
    --text-secondary: #9aa0a6;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --card-glow: rgba(79, 156, 249, 0.25);
    --login-bg: radial-gradient(circle at 10% 20%, rgba(13, 24, 52, 0.8) 0%, rgba(7, 13, 30, 1) 90%), #070d1e;
}

/* --- Base Resets & Layout --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-slow), color var(--transition-normal);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Hide helper class */
.hidden {
    display: none !important;
}

/* --- Login Page Overlay --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: var(--login-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity var(--transition-slow) ease, transform var(--transition-slow) ease;
}

.login-card {
    background: var(--bg-secondary);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    animation: loginCardAppear var(--transition-slow) cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    display: inline-flex;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

[data-theme="dark"] .input-group input {
    background: rgba(0, 0, 0, 0.25);
}

.input-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-glass-solid);
}

.login-error-msg {
    color: var(--color-photos);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    text-align: center;
    font-weight: 500;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-login {
    width: 100%;
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 120, 212, 0.3);
}

.btn-login:active {
    transform: translateY(1px);
}

/* --- Main Layout: App Wrapper --- */
.app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeIn var(--transition-slow) ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Header Section --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon-small {
    background: var(--accent-light);
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
}

.header-logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-light);
    color: var(--accent-primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: var(--radius-round);
}

.pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 8px var(--accent-primary); }
    100% { transform: scale(0.95); opacity: 0.5; }
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle Button */
.theme-toggle-btn, .logout-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover, .logout-btn:hover {
    background: var(--bg-glass-solid);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Toggle icon display based on current theme */
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }

/* --- Dashboard Grid System --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Services Container */
.services-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Windows 11 Card Styles */
.dash-card {
    background: var(--bg-secondary);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), var(--card-glow), transparent 40%);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.dash-card:hover::before {
    opacity: 1;
}

.service-card {
    display: flex;
    flex-direction: column;
    padding: 30px;
    cursor: pointer;
    height: 250px;
    justify-content: space-between;
}

.service-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-lg), 0 0 12px var(--card-glow);
    border-color: var(--accent-primary);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 2;
}

/* Icon Color Variations */
.color-files { background: rgba(0, 120, 212, 0.1); color: var(--color-files); }
.color-photos { background: rgba(232, 17, 35, 0.1); color: var(--color-photos); }
.color-passwords { background: rgba(16, 124, 65, 0.1); color: var(--color-passwords); }
.color-settings { background: rgba(92, 45, 145, 0.1); color: var(--color-settings); }

.service-card:hover .card-icon {
    transform: scale(1.1);
}

.card-content {
    position: relative;
    z-index: 2;
}

.card-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.card-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.card-link-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
    transition: color var(--transition-fast);
}

.card-link-label .arrow {
    transition: transform var(--transition-fast);
}

.service-card:hover .card-link-label .arrow {
    transform: translate(2px, -2px);
}

/* --- Status Panel & Monitoring --- */
.status-panel {
    display: flex;
    flex-direction: column;
}

.status-card {
    padding: 30px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.status-header h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.status-uptime {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: monospace;
    background: var(--border-color);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.metrics-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.metric-title {
    font-weight: 500;
    color: var(--text-primary);
}

.metric-value {
    color: var(--text-secondary);
    font-family: monospace;
}

/* Windows 11 rounded progress bar */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-slow);
}

.color-cpu { background: var(--accent-primary); }
.color-ram { background: var(--color-passwords); }
.color-storage { background: var(--color-settings); }

/* SVG Network Chart styles */
.network-chart-container {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
    padding: 6px;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .network-chart-container {
    background: rgba(255, 255, 255, 0.02);
}

.network-chart {
    width: 100%;
    height: 50px;
    display: block;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1010;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity var(--transition-normal) ease;
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.modal-card {
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalScaleUp var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-body h4 {
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Form switch controls inside settings modal */
.settings-switch-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.switch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.switch-label span {
    font-size: 14px;
    font-weight: 500;
}

.switch-label small {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Stylized switches */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.modal-footer {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* --- Responsive Layout Rules --- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .services-container {
        grid-template-columns: 1fr;
    }
    
    .app-container {
        padding: 20px 12px;
    }

    .main-header {
        margin-bottom: 24px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}

/* --- File Explorer Modal Styles --- */
.explorer-card {
    background: var(--bg-secondary);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 960px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalScaleUp var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.explorer-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

/* Toolbar */
.explorer-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .explorer-toolbar {
    background: rgba(255, 255, 255, 0.02);
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toolbar-btn:hover {
    background: var(--border-color);
}

.toolbar-btn:active {
    transform: scale(0.97);
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 4px;
}

/* Address Bar / Search */
.explorer-address-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.address-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-width: 0;
}

[data-theme="dark"] .address-box {
    background: rgba(0, 0, 0, 0.2);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.breadcrumbs::-webkit-scrollbar {
    display: none;
}

.breadcrumb-item {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.breadcrumb-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.breadcrumb-separator {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-box {
    width: 220px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .search-box {
    background: rgba(0, 0, 0, 0.2);
}

.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
}

/* Main panel (Sidebar + Content) */
.explorer-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.explorer-sidebar {
    width: 200px;
    border-right: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.05);
    padding: 12px 8px;
    overflow-y: auto;
}

[data-theme="dark"] .explorer-sidebar {
    background: rgba(255, 255, 255, 0.01);
}

.sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-item:hover {
    color: var(--text-primary);
    background: var(--border-color);
}

.sidebar-item.active {
    color: var(--accent-primary);
    background: var(--accent-light);
}

/* Content area */
.explorer-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-auto-rows: max-content;
    gap: 12px;
}

.explorer-content.dragover {
    background: var(--accent-light);
    outline: 2px dashed var(--accent-primary);
    outline-offset: -8px;
}

/* File item */
.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.file-item:hover {
    background: var(--border-color);
    border-color: var(--border-hover);
}

.file-icon {
    font-size: 36px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-primary);
}

.file-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* Quick Actions (displayed on hover) */
.file-item-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px;
    box-shadow: var(--shadow-sm);
}

.file-item:hover .file-item-actions {
    opacity: 1;
}

.file-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    display: flex;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.file-action-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.file-action-btn.btn-delete:hover {
    background: rgba(232, 17, 37, 0.1);
    color: var(--color-photos);
}

/* Status Bar */
.explorer-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.05);
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-secondary);
}

[data-theme="dark"] .explorer-status-bar {
    background: rgba(255, 255, 255, 0.01);
}

.upload-progress-text {
    font-weight: 600;
    color: var(--accent-primary);
}

/* Directory Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-secondary);
    gap: 12px;
}

.empty-state svg {
    opacity: 0.4;
}

.empty-state span {
    font-size: 14px;
    font-weight: 500;
}

/* Responsive file explorer */
@media (max-width: 600px) {
    .explorer-sidebar {
        display: none;
    }
    .search-box {
        display: none;
    }
    .explorer-card {
        height: 95vh;
    }
}

/* --- File Preview Modal Styles --- */
.preview-card {
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalScaleUp var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.preview-body {
    padding: 20px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    min-height: 200px;
}

[data-theme="light"] .preview-body {
    background: rgba(0, 0, 0, 0.03);
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.preview-video {
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-sm);
    outline: none;
    box-shadow: var(--shadow-md);
}

.preview-audio {
    width: 100%;
    max-width: 500px;
    outline: none;
}

.preview-text {
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    text-align: left;
    font-family: monospace;
    font-size: 13px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #f0f0f0;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: pre-wrap;
    word-break: break-all;
}

[data-theme="light"] .preview-text {
    background: #fafafa;
    color: #222;
    border-color: rgba(0, 0, 0, 0.15);
}

/* --- Vaultwarden Modal Card --- */
.vault-card {
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1000px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalScaleUp var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vault-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* --- Custom Password Manager Styles --- */
.vault-modal-body {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
}

.vault-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    align-content: start;
}

.vault-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .vault-toolbar {
    background: rgba(255, 255, 255, 0.02);
}

.vault-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    transition: all var(--transition-fast);
}

[data-theme="light"] .vault-item-card {
    background: rgba(0, 0, 0, 0.02);
}

.vault-item-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .vault-item-card:hover {
    background: rgba(0, 0, 0, 0.04);
}

.vault-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

[data-theme="light"] .vault-item-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.vault-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.vault-item-controls {
    display: flex;
    gap: 6px;
}

.vault-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vault-field-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.vault-field-label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vault-field-value-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vault-field-value {
    font-family: monospace;
    color: var(--text-primary);
}

.vault-form-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: var(--bg-glass-solid);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(0);
    z-index: 10;
}

.vault-form-panel.hidden {
    transform: translateX(100%);
    display: none !important;
}

.form-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.vault-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input, .form-group textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
}

[data-theme="light"] .form-group input, [data-theme="light"] .form-group textarea {
    background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--accent-primary);
}
