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

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
    padding: 20px;
    animation: fadeIn 0.8s ease;
}

/* LAYOUT */
.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    margin-top: 10px;
}

/* CARD */
.card {
    background: #111827;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.05);
    animation: fadeUp 0.4s ease;
}

/* HEADINGS */
h1, h2 {
    margin-bottom: 16px;
    font-weight: 600;
    color: #f8fafc;
}

/* TEXT */
p {
    margin-bottom: 10px;
    color: #cbd5f5;
}

/* FORM */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input,
select {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e2e8f0;
    font-size: 14px;
    transition: border 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

/* BUTTON */
button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #3b82f6;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

button:hover {
    background: #2563eb;
}

button:active {
    transform: scale(0.97);
}

/* LINKS */
a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* LIST */
ul {
    list-style: none;
    margin-top: 16px;
    padding-left: 0;
}

li {
    padding: 12px;
    border-radius: 8px;
    background: #020617;
    border: 1px solid #1f2937;
    margin-bottom: 10px;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* nested files */
li ul {
    margin-top: 10px;
    padding-left: 12px;
}

li ul li {
    background: #020617;
    font-size: 14px;
}

/* ERROR PAGE */
.error-container {
    text-align: center;
}

.error-code {
    font-size: 64px;
    color: #ef4444;
    margin-bottom: 10px;
}

.error-home {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 16px;
    background: #3b82f6;
    border-radius: 8px;
    color: white;
}

.error-message {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(239,68,68,0.3);
    margin-bottom: 12px;
}

/* FILE DETAILS */
.file-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* FILE INPUT */
.file-label {
    display: inline-block;
    padding: 12px 16px;
    background: #1f2937;
    border: 1px dashed #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    color: #cbd5f5;
    text-align: center;
    transition: all 0.2s ease;
}

.file-label:hover {
    background: #111827;
    border-color: #60a5fa;
}

.file-label:active {
    transform: scale(0.97);
}

#fileName {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 6px;
    display: block;
}

/* NAVBAR */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(2, 6, 23, 0.7);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(2, 6, 23, 0.95);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 900px;
    margin: auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 30px;
    font-weight: 600;
    color: #f8fafc;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    position: relative;
    font-size: 14px;
    color: #cbd5f5;
    padding: 6px 4px;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

nav a:hover {
    color: #fff;
}

nav a:hover::after {
    width: 100%;
}

.logout {
    color: #f87171;
}

.logout:hover {
    color: #ef4444;
}

/* HAMBURGER */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    height: 3px;
    width: 25px;
    background: white;
    margin: 4px 0;
}

/* SHARED FOLDER */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-link {
    background: #3b82f6;
    padding: 6px 10px;
    border-radius: 6px;
    color: white;
}

/* FOLDER ACTIONS */
.folder-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* SHARE */
.share-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.share-duration {
    width: 70px;
    padding: 6px;
    font-size: 13px;
}

.share-btn {
    padding: 6px 10px;
    font-size: 13px;
    background: #8b5cf6;
    margin-bottom: 6px;
}

.share-btn:hover {
    background: #7c3aed;
}

/* DELETE */
.delete-btn {
    padding: 6px 10px;
    font-size: 13px;
    background: #ef4444;
}

.delete-btn:hover {
    background: #dc2626;
}

.logo {
    font-size: 30px;
    font-weight: 600;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #22c55e);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradientMove 4s linear infinite;
}

.layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
}

.sidebar .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}


.main-content {
    flex: 1;
    min-width: 0;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card .logo {
    margin-bottom: 10px;
}

/* MOBILE */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

@keyframes gradientMove {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

/* MOBILE */

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: static;  
        height: auto;      
        width: 100%;
    }

    .main-content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        position: absolute;
        top: 70px;
        right: 20px;
        background: #020617;
        flex-direction: column;
        width: 200px;
        padding: 15px;
        border-radius: 10px;

        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: all 0.3s ease;
    }

    nav.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    nav a {
        padding: 10px;
    }
}

/* ANIMATIONS */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* RESPONSIVE */
@media (min-width: 640px) {
    body {
        padding: 40px;
    }
}