/* Base Variables & Reset */
:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #334155;
    --secondary-hover: #475569;
    --error: #ef4444;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* --- Login Page --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
}

/* Background animation */
.background-animation {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    animation: pulse 10s infinite alternate;
}
@keyframes pulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; transform: scale(1.05); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fade-in-up 0.8s ease forwards;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-box {
    padding: 40px 30px;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

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

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.input-group input[readonly] {
    color: var(--text-muted);
    cursor: not-allowed;
}

.error-message {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 8px;
    display: none;
}
.error-message.show {
    display: block;
    animation: shake 0.4s ease;
}

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

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

.hint-wrapper {
    position: relative;
    flex: 1;
}
.hint-wrapper .btn {
    width: 100%;
}

.tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: #fff;
    color: #000;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* --- NAS Page --- */
.nas-body {
    height: 100vh;
    display: flex;
    padding: 20px;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCI+PGNpcmNsZSBjeD0iMjAiIGN5PSIyMCIgcj0iMSIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSIvPjwvc3ZnPg==') var(--bg-color);
}

.nas-container {
    display: flex;
    width: 100%;
    gap: 20px;
    height: 100%;
}

.nas-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
}

.sidebar-menu li {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
    color: var(--text-muted);
}
.sidebar-menu li:hover {
    background: rgba(255, 255, 255, 0.05);
}
.sidebar-menu li.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.sidebar-user {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.nas-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nas-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-grid {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    gap: 20px;
}

.file-item {
    width: 120px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 600;
    word-break: break-all;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    padding: 30px;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

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

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.btn-close:hover {
    color: var(--text-main);
}

.modal-body p {
    margin-bottom: 15px;
    font-family: monospace;
    font-size: 1.05rem;
    line-height: 1.8;
}
