:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --danger: #ef4444;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --selection: rgba(99, 102, 241, 0.3);
}

::selection {
    background: var(--selection);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .separator {
    font-size: 0.7rem;
    opacity: 0.3;
}

.breadcrumbs span {
    color: var(--text-main);
    font-weight: 600;
}

.btn-action-centered {
    background: var(--glass);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-action-centered:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
    color: white;
}

.upload-actions {
    display: flex;
    justify-content: center;
    margin-top: -1.5rem;
    /* Overlap slightly with upload zone margin */
    margin-bottom: 3rem;
    position: relative;
    z-index: 10;
}

.btn-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-profile:hover {
    background: var(--glass-border);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.sort-select {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: var(--text-main);
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.sort-select:hover {
    border-color: var(--primary);
    background-color: var(--glass-border);
}

.controls-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.sort-select option {
    background: var(--bg-dark);
    color: var(--text-main);
}

/* Upload Section */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 2px dashed var(--glass-border);
    border-radius: 1.5rem;
    padding: 5rem 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    margin-bottom: 3rem;
    width: 100%;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
}

.upload-zone.highlight {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.05);
}

.upload-zone i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.upload-zone:hover i {
    transform: translateY(-5px);
}

.upload-zone h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 400px;
}

.upload-zone p.muted {
    font-size: 0.8rem;
    margin-top: 1rem;
    opacity: 0.6;
}

#file-input {
    display: none;
}

/* Media Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.media-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.preview-container {
    height: 180px;
    width: 100%;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-container img,
.preview-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Folder Specific */
.folder-card {
    cursor: pointer;
}

.folder-link {
    text-decoration: none;
    color: inherit;
}

.folder-preview {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.1)) !important;
}

.folder-preview i {
    color: var(--primary);
    font-size: 4rem !important;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.card-overlay-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-card:hover .card-overlay-actions {
    opacity: 1;
}

.btn-sm {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-content input {
    width: 100%;
    padding: 1rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: white;
    margin-bottom: 2rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.modal-content input:focus {
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.btn-create {
    background: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.card-info {
    padding: 1.25rem;
}

.card-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text-muted);
}

.btn:hover {
    transform: translateY(-2px);
    background: var(--glass-border);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.btn-download:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-copy:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: var(--danger);
}

/* Toast Notification (Simple) */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
    transform: translateY(100px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    color: var(--text-muted);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.2;
}

.empty-state p {
    font-size: 1.1rem;
    max-width: 300px;
    line-height: 1.6;
}

/* Upload Progress Bar */
.upload-status-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 320px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.upload-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-status-header span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.progress-wrapper {
    width: 100%;
    height: 6px;
    background: var(--glass);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.upload-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.media-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Custom Alert Popup */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.alert-overlay.show {
    display: flex;
}

.alert-popup {
    background: var(--bg-dark);
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: alertPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes alertPop {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.alert-icon {
    width: 60px;
    height: 60px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.alert-msg {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.btn-alert-close {
    background: var(--primary);
    color: white;
    padding: 0.75rem 2.5rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-alert-close:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Profile Page Styles */
.profile-section {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
}

.profile-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 3rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 40px 60px -15px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.6s ease-out;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.profile-names h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.profile-names p {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.storage-usage-container {
    background: var(--glass);
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.usage-progress-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.usage-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.usage-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-item {
    background: var(--glass);
    padding: 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0.8;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.profile-actions {
    display: flex;
    justify-content: center;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.api-value-box {
    background: #020617;
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.api-value-box code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    word-break: break-all;
}

.secret-box code {
    color: var(--text-muted);
}

.btn-toggle-view,
.btn-api-copy {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-toggle-view:hover,
.btn-api-copy:hover {
    color: var(--text-main);
}