/* ===========================
   Material Design File Sharing
   =========================== */

:root {
    --primary: #2962FF;
    --primary-dark: #0039CB;
    --secondary: #00C853;
    --background: #F5F5F5;
    --surface: #FFFFFF;
    --error: #D32F2F;
    --text-primary: #212121;
    --text-secondary: #757575;
    --divider: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ===========================
   Material Cards
   =========================== */
.material-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    overflow: hidden;
}

.material-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.elevated-card {
    box-shadow: var(--shadow-md);
}

/* ===========================
   Top App Bar
   =========================== */
.app-bar {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
    height: 64px;
}

.app-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-logo {
    font-size: 24px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 24px;
    transition: background 0.2s;
}

.user-profile:hover {
    background: rgba(0, 0, 0, 0.04);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 16px;
}

/* ===========================
   Sidebar
   =========================== */
.sidebar {
    width: 260px;
    background: var(--surface);
    height: calc(100vh - 64px);
    position: fixed;
    left: 0;
    top: 64px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 998;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-nav {
    list-style: none;
    padding: 12px 8px;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-link:hover {
    background: rgba(41, 98, 255, 0.08);
    color: var(--primary);
}

.sidebar-link.active {
    background: rgba(41, 98, 255, 0.12);
    color: var(--primary);
}

.sidebar-link .material-icons-round {
    font-size: 24px;
}

/* ===========================
   Main Content
   =========================== */
.main-content {
    margin-left: 260px;
    padding: 24px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: calc(100vh - 64px);
}

.main-content.expanded {
    margin-left: 0;
}

/* ===========================
   Breadcrumbs
   =========================== */
.breadcrumb-material {
    background: transparent;
    padding: 0;
    margin-bottom: 24px;
    font-size: 14px;
}

.breadcrumb-material .breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-material .breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-material a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb-material a:hover {
    text-decoration: underline;
}

/* ===========================
   File Grid
   =========================== */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.file-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.file-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.file-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 8px;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.file-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-card:hover .file-actions {
    opacity: 1;
}

/* ===========================
   FAB (Floating Action Button)
   =========================== */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.fab:hover {
    background: var(--primary-dark);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    transform: scale(1.1);
}

.fab .material-icons-round {
    font-size: 24px;
}

/* ===========================
   Material Buttons
   =========================== */
.btn-material {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-material {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary-material:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary-material {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--divider);
}

.btn-secondary-material:hover {
    background: rgba(41, 98, 255, 0.08);
}

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.icon-button:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ===========================
   Material Input
   =========================== */
.input-material {
    position: relative;
    margin-bottom: 24px;
}

.input-material input,
.input-material textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: var(--surface);
}

.input-material input:focus,
.input-material textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.1);
}

.input-material label {
    position: absolute;
    left: 16px;
    top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
    pointer-events: none;
    background: var(--surface);
    padding: 0 4px;
}

.input-material input:focus + label,
.input-material input:not(:placeholder-shown) + label {
    top: -8px;
    font-size: 12px;
    color: var(--primary);
}

/* ===========================
   Upload Zone
   =========================== */
.upload-zone {
    border: 2px dashed var(--divider);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(41, 98, 255, 0.04);
}

.upload-zone .material-icons-round {
    font-size: 64px;
    color: var(--primary);
    margin-bottom: 16px;
}

/* ===========================
   Progress Bar
   =========================== */
.progress-material {
    height: 4px;
    background: #E0E0E0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-material {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* ===========================
   Modal
   =========================== */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--divider);
    padding: 20px 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--divider);
    padding: 16px 24px;
}

/* ===========================
   Ripple Effect
   =========================== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===========================
   Auth Pages
   =========================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===========================
   Statistics Cards
   =========================== */
.stat-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.primary {
    background: rgba(41, 98, 255, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(0, 200, 83, 0.1);
    color: var(--secondary);
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

/* ===========================
   Animations
   =========================== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Scrollbar
   =========================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: #BDBDBD;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9E9E9E;
}