/* Mbenz Premium Dark Theme CSS */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
    --bg-dark: #0a0a0c;
    --bg-card: #121218;
    --bg-input: #1a1a24;
    --text-primary: #ffffff;
    --text-secondary: #9ea2b0;
    --accent: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.2);
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 240, 255, 0.5);
    --transition-speed: 0.25s;
    --font-family: 'Outfit', 'Noto Sans KR', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header & Navbar */
header {
    background-color: rgba(18, 18, 24, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-dark);
    font-weight: 600;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.4);
}

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

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: var(--accent-red);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background-color: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Login Container */
.login-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 20%;
    left: 15%;
    z-index: -1;
    pointer-events: none;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    bottom: 20%;
    right: 15%;
    z-index: -1;
    pointer-events: none;
}

.login-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform var(--transition-speed) ease;
}

.login-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.login-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-speed) ease;
}

.input-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Alert Message */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: none;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
}

/* Info Bar */
.info-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.timer {
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.timer.warning {
    color: var(--accent-red);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Explorer Layout */
.explorer-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.explorer-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

/* Directory Tree View */
.tree-container {
    min-height: 250px;
}

.tree-node {
    list-style: none;
    margin-left: 1.2rem;
    position: relative;
}

.tree-container > .tree-node {
    margin-left: 0;
}

/* Directory/File Row */
.tree-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.tree-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.node-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
}

.icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.folder-icon {
    color: #ffd24c;
}

.file-icon {
    color: #4da3ff;
}

.node-name {
    font-size: 0.95rem;
    font-weight: 400;
}

.node-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.node-size {
    width: 80px;
    text-align: right;
}

.node-date {
    display: none; /* Hide on small screens */
}

@media (min-width: 768px) {
    .node-date {
        display: block;
        width: 150px;
        text-align: right;
    }
}

.download-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.download-link:hover {
    background-color: var(--accent-glow);
    transform: scale(1.1);
}

/* Nested container for children */
.tree-children {
    display: block;
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
}

.tree-children.collapsed {
    display: none;
}

/* Empty Folder/File List Message */
.empty-msg {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* ADMIN PANEL STYLES */
.admin-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.admin-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-table-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    font-weight: 500;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    background-color: var(--bg-card);
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-revoked {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}

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

/* Toggle Arrow for folders */
.arrow-icon {
    display: inline-block;
    transition: transform var(--transition-speed) ease;
    font-size: 0.7rem;
    margin-right: 0.2rem;
}

.arrow-icon.collapsed {
    transform: rotate(-90deg);
}

/* Double Pane Explorer Layout */
.explorer-layout {
    display: flex;
    gap: 1.5rem;
    min-height: 500px;
    margin-top: 1rem;
}

.explorer-sidebar {
    width: 250px;
    border-right: 1px solid var(--border-color);
    padding-right: 1rem;
    overflow-y: auto;
    max-height: 600px;
}

.explorer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 600px;
}

/* Breadcrumbs Styling */
.breadcrumbs-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.02);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.breadcrumb-item {
    cursor: pointer;
    transition: color var(--transition-speed);
}

.breadcrumb-item:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.2);
}

/* Right pane list layout */
.file-list-row {
    transition: background-color 0.15s ease;
}

.file-list-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.file-list-name-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.sidebar-folder-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

.sidebar-folder-item:hover, .sidebar-folder-item.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

.sidebar-folder-item.active {
    border-left: 2px solid var(--accent);
    color: var(--accent);
}

@media (max-width: 768px) {
    .explorer-layout {
        flex-direction: column;
    }
    .explorer-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 1rem;
        max-height: 250px;
    }
    .explorer-main {
        max-height: none;
    }
}
