@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Clean SaaS Palette */
    --bg: #F5F5F7;           /* Light Grey / White Smoke */
    --surface: #FFFFFF;      /* Pure White */
    --surface-hover: #F2F2F2;
    --border: #E5E5EA;       /* Very subtle border */

    --primary: #5865F2;      /* Blurple (Discord-like) */
    --primary-hover: #4752C4;

    --text: #1D1D1F;         /* Apple Dark Grey */
    --text-muted: #86868B;

    --danger: #FF3B30;
    --success: #34C759;

    --radius: 16px;          /* Soft, rounded corners */
    --font-main: 'Inter', sans-serif;

    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 99px; /* Pill shape */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--surface-hover);
    border-color: #D1D1D6;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover, .btn-icon.active {
    background-color: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-soft);
}

/* Form Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

/* Layout: Dashboard */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.profile i {
    font-size: 2.5rem;
    color: var(--primary);
}

.profile h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.sidebar nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar nav a:hover {
    background-color: var(--bg);
    color: var(--text);
}

.sidebar nav li.active a {
    background-color: rgba(88, 101, 242, 0.1);
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow: hidden;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    height: 60px;
}

.header-actions h1 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions h1 i {
    color: var(--primary);
}

.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.view-toggle {
    display: flex;
    background: var(--surface);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Drive Interface (Card Style) */
.drive-interface {
    flex: 1;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.breadcrumbs {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.breadcrumbs .crumb {
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumbs .crumb:hover {
    color: var(--primary);
}

.breadcrumbs .crumb:not(:last-child):after {
    content: '/';
    margin-left: 0.5rem;
    color: #C7C7CC;
}

.breadcrumbs .crumb:last-child {
    color: var(--text);
    cursor: default;
}

/* File Browser */
.file-browser {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Grid View */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem;
}

.grid-item {
    background-color: var(--bg);
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    aspect-ratio: 1 / 1;
}

.grid-item:hover {
    background-color: var(--surface-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}

.grid-item.selected {
    border-color: var(--primary);
    background-color: rgba(88, 101, 242, 0.05);
}

.grid-item .icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.grid-item .icon.folder {
    color: #FFCC00; /* Mac-like folder yellow */
}

.grid-item:hover .icon {
    opacity: 0.8;
}

.grid-item .name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* List View */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    display: grid;
    grid-template-columns: 40px 1fr 100px 150px;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border);
}

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

.list-item.selected {
    background-color: rgba(88, 101, 242, 0.1);
}

.list-item .icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}
.list-item .icon.folder { color: #FFCC00; }

.list-item .name { font-weight: 500; }
.list-item .meta { font-size: 0.9rem; color: var(--text-muted); text-align: right; }

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-weight: 500;
    gap: 1rem;
}

/* Drag Overlay */
.drag-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(5px);
}

.drag-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.drag-message {
    text-align: center;
    color: var(--primary);
}

.drag-message i { font-size: 4rem; margin-bottom: 1rem; }
.drag-message h3 { font-size: 1.5rem; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--surface);
    border: none;
    border-radius: 24px;
    padding: 0;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

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

.modal-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }

.modal-body { padding: 2rem; }
.modal-footer { padding: 1.5rem 2rem; text-align: right; background-color: #FAFAFA; border-top: 1px solid var(--border); }

.close {
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.close:hover { color: var(--text); }

/* Context Menu */
.context-menu {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 220px;
    box-shadow: var(--shadow-hover);
    z-index: 999;
    padding: 0.5rem;
}

.context-menu ul li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    transition: background 0.1s;
}

.context-menu ul li:hover {
    background-color: var(--bg);
}

.context-menu ul li i { width: 20px; text-align: center; color: var(--text-muted); }
.context-menu ul li:hover i { color: var(--primary); }

.context-menu ul li.text-danger:hover { color: var(--danger); background-color: rgba(255, 59, 48, 0.1); }
.context-menu ul li.text-danger i { color: var(--danger); }

/* Upload Status Panel */
.upload-status-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    display: none; /* hidden by default */
    flex-direction: column;
    z-index: 900;
}

.upload-status-panel.minimized .panel-body { display: none; }

.panel-header {
    padding: 1rem 1.5rem;
    background: #FAFAFA;
    border-bottom: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.panel-controls i { margin-left: 0.75rem; cursor: pointer; color: var(--text-muted); }
.panel-controls i:hover { color: var(--text); }

.panel-body {
    max-height: 250px;
    overflow-y: auto;
}

.upload-list { padding: 0; margin: 0; list-style: none; }

.upload-item {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.upload-item .item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
}

.progress-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.2s;
}

.upload-item.success .progress-fill { background: var(--success); }
.upload-item.error .progress-fill { background: var(--danger); }

/* Toast / Floating Alerts */
.alert-floating {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-hover);
    z-index: 2000;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { transform: translate(-50%, -40px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.alert-success i { color: var(--success); }
.alert-error i { color: var(--danger); }

/* Auth Pages (Login/Register) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg);
    position: relative;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.auth-header {
    margin-bottom: 2.5rem;
}

.auth-header h2 { font-size: 1.75rem; margin-bottom: 0.5rem; color: var(--text); }
.auth-header p { color: var(--text-muted); font-size: 1.1rem; }

.auth-footer {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* Landing Page (Clean SaaS) */
.landing-page {
    background-color: var(--surface);
    color: var(--text);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.5rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.logo i { color: var(--primary); }

.hero-section {
    max-width: 900px;
    margin: 6rem auto;
    text-align: center;
    padding: 0 2rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.hero-section p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
    font-weight: 500;
}

.features-section {
    max-width: 1100px;
    margin: 6rem auto;
    padding: 0 2rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg);
    border-radius: 24px;
    padding: 2.5rem;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.feature-card p { color: var(--text-muted); line-height: 1.6; }

.feature-icon-wrapper {
    width: 50px;
    height: 50px;
    background: var(--surface);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container { flex-direction: column; overflow-y: auto; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 1rem; }
    .sidebar nav ul { flex-direction: row; overflow-x: auto; padding-bottom: 0.5rem; }
    .main-content { padding: 1rem; }
    .hero-section h1 { font-size: 2.5rem; }
    .cards-grid { grid-template-columns: 1fr; }
}