:root {
    --bg-color: #0b0f19;
    --sidebar-bg: rgba(15, 23, 42, 0.6);
    --main-bg: rgba(15, 23, 42, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: #0284c7;
    --border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(30, 41, 59, 0.6);
    --hover-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ambient Animated Blobs */
.blob {
    position: absolute;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
    animation: float 25s infinite ease-in-out alternate;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #38bdf8, transparent 70%);
    top: -200px;
    left: -200px;
}

.blob-2 {
    width: 600px;
    height: 500px;
    background: radial-gradient(circle, #7e22ce, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #0284c7, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(100px, 150px) scale(1.3) rotate(180deg);
    }

    100% {
        transform: translate(-50px, -100px) scale(1.1) rotate(360deg);
    }
}

/* Glassmorphism App Layout */
.app-container {
    width: 95vw;
    height: 95vh;
    background: var(--main-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    display: flex;
    flex-direction: row;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 3.5rem;
}

.logo i {
    font-size: 2.5rem;
    color: var(--accent);
    filter: drop-shadow(0 0 12px var(--accent-glow));
    animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 12px var(--accent-glow));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px var(--accent-glow));
    }
}

.logo h2 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 14px 20px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover,
nav a.active {
    background: var(--card-bg);
    color: var(--text-primary);
    transform: translateX(5px);
}

nav a.active {
    position: relative;
    box-shadow: inset 0 0 0 1px var(--border);
}

nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 50%;
    background: var(--accent);
    border-radius: 0 5px 5px 0;
    box-shadow: 0 0 10px var(--accent-glow);
}

.storage-info {
    margin-top: auto;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.storage-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), transparent);
    z-index: 0;
}

.storage-info>* {
    position: relative;
    z-index: 1;
}

.storage-text {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: #fff;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.storage-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.hosting-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Main Workspace */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 2rem 3rem;
    overflow-y: auto;
    scroll-behavior: smooth;
    height: 100%;
}

/* Custom Scrollbar */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.search-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 380px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.15);
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.8);
}

.search-bar i {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 1.05rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 24px;
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.primary-btn {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.3);
}

.primary-btn i {
    font-size: 1.2rem;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(56, 189, 248, 0.5);
}

.avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.avatar img:hover {
    transform: scale(1.1);
}

/* Workspace Sections */
.area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.area-header h3 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.view-toggles {
    display: flex;
    gap: 8px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.view-toggles button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.view-toggles button.active,
.view-toggles button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.drop-zone {
    border: 2px dashed rgba(56, 189, 248, 0.4);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.4) 0%, rgba(30, 41, 59, 0.2) 100%);
    margin-bottom: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
    border-radius: 50%;
    transition: all 0.4s ease;
    z-index: 0;
}

.drop-zone.dragover {
    border-color: var(--accent);
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.15);
}

.drop-zone.dragover::before {
    width: 150%;
    height: 150%;
}

.drop-content {
    position: relative;
    z-index: 1;
}

.drop-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 15px rgba(56, 189, 248, 0.4));
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.drop-zone p {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.drop-zone span {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.file-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.file-card:hover::before {
    opacity: 1;
}

.file-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #cbd5e1;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.file-card:hover .file-icon {
    transform: scale(1.1) rotate(2deg);
}

/* Colors for specific file types */
.file-icon.pdf {
    color: #ef4444;
    filter: drop-shadow(0 10px 15px rgba(239, 68, 68, 0.3));
}

.file-icon.image {
    color: #38bdf8;
    filter: drop-shadow(0 10px 15px rgba(56, 189, 248, 0.3));
}

.file-icon.doc {
    color: #3b82f6;
    filter: drop-shadow(0 10px 15px rgba(59, 130, 246, 0.3));
}

.file-icon.folder {
    color: #fbbf24;
    filter: drop-shadow(0 10px 15px rgba(251, 191, 36, 0.3));
}

.file-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 6px;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    position: relative;
    z-index: 1;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.file-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.file-card:hover .file-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    backdrop-filter: blur(5px);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--accent);
    transform: scale(1.1);
    border-color: transparent;
}

.action-btn.delete:hover {
    background: #ef4444;
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-right-color: var(--accent);
    border-bottom-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Flashy Notifications */
#toast-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.toast {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-left: 5px solid var(--accent);
    color: white;
    padding: 16px 28px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: slideInBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.05rem;
}

.toast i {
    font-size: 1.3rem;
    color: var(--accent);
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.error i {
    color: #ef4444;
}

@keyframes slideInBounce {
    0% {
        transform: translateX(120%);
        opacity: 0;
    }

    70% {
        transform: translateX(-10px);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ---------------------------------
   File Preview Modal 
-----------------------------------*/
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-modal.active {
    display: flex;
    opacity: 1;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(30, 41, 59, 0.6);
    border-bottom: 1px solid var(--border);
}

.preview-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.preview-actions {
    display: flex;
    gap: 15px;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.icon-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.icon-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.preview-body {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    overflow: auto;
}

.preview-content {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.preview-text {
    background: #1e293b;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    height: 100%;
    color: #f8fafc;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.preview-zip-list {
    background: #1e293b;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    border: 1px solid var(--border);
    max-height: 80vh;
    overflow-y: auto;
}

.zip-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.zip-item:last-child {
    border-bottom: none;
}

.zip-item i {
    color: var(--accent);
}

.preview-unsupported {
    text-align: center;
    color: var(--text-secondary);
}

.preview-unsupported i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1024px) {
    .sidebar {
        width: 100px;
        padding: 2rem 1rem;
    }

    .logo h2,
    nav a span,
    .storage-info {
        display: none;
    }

    .logo i {
        font-size: 2rem;
        margin: 0 auto;
    }

    nav a {
        justify-content: center;
        padding: 15px 0;
    }

    nav a i {
        font-size: 1.4rem;
        margin: 0;
    }
}