/* ============================================
   ELEKTRO SPEKTAR - Premium File Explorer
   Modern, Professional, Enterprise-Grade Design
   ============================================ */

/* CSS Variables for consistent theming */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --bg-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;

    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Background with subtle pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   ICONS (CSS-based, no emojis)
   ============================================ */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    flex-shrink: 0;
}

.icon-folder::before {
    content: '';
    width: 18px;
    height: 14px;
    background: var(--accent-primary);
    border-radius: 2px 2px 3px 3px;
    position: relative;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1);
}

.icon-folder::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    width: 8px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
}

.icon-file::before {
    content: '';
    width: 14px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 2px;
    position: relative;
}

.icon-file::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 5px;
    background: var(--bg-tertiary);
    border-bottom-left-radius: 2px;
}

.icon-lock::before {
    content: '';
    width: 12px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 2px;
    position: relative;
}

.icon-lock::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border: 2px solid currentColor;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    animation: fadeIn 0.5s ease;
}

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

/* ============================================
   HEADER
   ============================================ */
header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

header h1::before {
    content: '';
    width: 8px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-info strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.breadcrumbs a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.breadcrumbs a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.breadcrumbs span {
    color: var(--text-muted);
}

/* ============================================
   FILE LIST
   ============================================ */
.file-list {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.file-header {
    display: grid;
    grid-template-columns: 1fr 120px 180px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.file-item {
    display: grid;
    grid-template-columns: 1fr 120px 180px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.file-item:last-child {
    border-bottom: none;
}

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

.file-item.folder {
    background: rgba(59, 130, 246, 0.03);
}

.file-item.folder:hover {
    background: rgba(59, 130, 246, 0.08);
}

.file-name {
    font-weight: 500;
    display: flex;
    align-items: center;
}

.file-name a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
}

.file-name a:hover {
    color: var(--accent-primary);
}

.file-size {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.file-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

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

.btn-small {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-download {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border: none;
    color: white;
}

.btn-download:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-logout {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

.btn-login {
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 1rem;
    padding: 14px 28px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-login:hover {
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-box {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeIn 0.6s ease;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 24px;
}

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

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-family: inherit;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.875rem;
}

.demo-info {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.demo-info h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-align: center;
}

.demo-credentials {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.demo-card {
    background: var(--bg-secondary);
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    text-align: center;
}

.demo-card .username {
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.demo-card .password {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.toggle-password {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 0;
    transition: var(--transition-fast);
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* ============================================
   FILE VIEWER
   ============================================ */
.file-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    min-height: 400px;
}

.file-content pre {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    overflow-x: auto;
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.file-content pre code {
    background: none;
    padding: 0;
}

.warning {
    text-align: center;
    padding: 48px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    color: var(--warning);
}

.file-actions-bottom {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .file-header {
        display: none;
    }

    .file-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px 20px;
    }

    .file-size {
        font-size: 0.8rem;
    }

    .file-actions {
        justify-content: flex-start;
    }

    .login-box {
        padding: 32px 24px;
        margin: 0 8px;
    }

    .demo-credentials {
        grid-template-columns: 1fr;
    }

    .breadcrumbs {
        font-size: 0.8rem;
        padding: 12px 16px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}

/* ============================================
   FOCUS VISIBLE
   ============================================ */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   CORNER LOGO
   ============================================ */
.corner-logo {
    position: fixed;
    bottom: 10px;
    right: 5px;
    width: 50px;
    height: auto;
    opacity: 0.7;
    transition: var(--transition-fast);
    z-index: 1000;
}

.corner-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .corner-logo {
        width: 50px;
        bottom: 10px;
        right: 5px;
    }
}
