/* ====================================
   SHARER — Ultra-Premium Dynamic UI
   ==================================== */

/* ---- CUSTOM PROPERTIES ---- */
:root {
    --bg-dark: #060b0c;
    --bg-card: rgba(12, 24, 26, 0.65);
    --bg-card-solid: #0c181a;
    --bg-card-hover: rgba(18, 34, 38, 0.75);
    --bg-surface: rgba(14, 28, 30, 0.7);
    --bg-input: rgba(18, 36, 38, 0.8);
    --border: rgba(30, 60, 65, 0.5);
    --border-light: rgba(50, 95, 100, 0.6);
    --border-glow: rgba(10, 186, 181, 0.2);
    --text: #e8f4f3;
    --text-muted: #7ebfb8;
    --text-dim: #3d7a74;
    --accent: #0abab5;
    --accent-light: #81d8d0;
    --accent-bright: #00f0e9;
    --accent-glow: rgba(10, 186, 181, 0.3);
    --accent-glow-strong: rgba(10, 186, 181, 0.5);
    --success: #2ed8a3;
    --success-glow: rgba(46, 216, 163, 0.25);
    --danger: #e17055;
    --danger-glow: rgba(225, 112, 85, 0.2);
    --warning: #f0c75e;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 50px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 40px rgba(10, 186, 181, 0.12);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(10, 20, 22, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: blur(24px);
}

/* ---- RESET & GLOBAL ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

/* ---- ANIMATED BACKGROUND ---- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 15% 0%, rgba(10, 186, 181, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(129, 216, 208, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 240, 233, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: bgShift 12s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(10, 186, 181, 0.05) 1px, transparent 0);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

@keyframes bgShift {
    0% {
        background:
            radial-gradient(ellipse at 15% 0%, rgba(10, 186, 181, 0.12) 0%, transparent 55%),
            radial-gradient(ellipse at 85% 100%, rgba(129, 216, 208, 0.08) 0%, transparent 55%),
            radial-gradient(ellipse at 50% 50%, rgba(0, 240, 233, 0.03) 0%, transparent 70%);
    }
    33% {
        background:
            radial-gradient(ellipse at 40% 10%, rgba(10, 186, 181, 0.14) 0%, transparent 55%),
            radial-gradient(ellipse at 60% 90%, rgba(129, 216, 208, 0.1) 0%, transparent 55%),
            radial-gradient(ellipse at 20% 60%, rgba(0, 240, 233, 0.04) 0%, transparent 70%);
    }
    66% {
        background:
            radial-gradient(ellipse at 70% 5%, rgba(0, 240, 233, 0.1) 0%, transparent 55%),
            radial-gradient(ellipse at 30% 95%, rgba(10, 186, 181, 0.12) 0%, transparent 55%),
            radial-gradient(ellipse at 80% 40%, rgba(129, 216, 208, 0.05) 0%, transparent 70%);
    }
    100% {
        background:
            radial-gradient(ellipse at 60% 0%, rgba(10, 186, 181, 0.11) 0%, transparent 55%),
            radial-gradient(ellipse at 20% 100%, rgba(0, 240, 233, 0.09) 0%, transparent 55%),
            radial-gradient(ellipse at 90% 50%, rgba(129, 216, 208, 0.04) 0%, transparent 70%);
    }
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    letter-spacing: 0.01em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 25%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 75%
    );
    transition: left 0.6s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.97) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    box-shadow: 0 2px 16px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
    box-shadow: 0 6px 30px var(--accent-glow-strong), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-ghost {
    background: var(--glass-bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    box-shadow: 0 0 20px rgba(10, 186, 181, 0.06);
    transform: translateY(-1px);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(225, 112, 85, 0.3);
}

.btn-danger:hover {
    background: var(--danger-glow);
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(225, 112, 85, 0.15);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #5ce0bd);
    color: #fff;
    box-shadow: 0 2px 16px var(--success-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-success:hover {
    box-shadow: 0 6px 30px var(--success-glow);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    width: 38px;
    height: 38px;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
    padding: 4px;
}

/* ---- HEADER (Premium Glass) ---- */
.app-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    height: 64px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(6, 11, 12, 0.7);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow:
        0 1px 0 rgba(10, 186, 181, 0.06),
        0 4px 30px rgba(0, 0, 0, 0.3);
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(10, 186, 181, 0.2) 20%,
        rgba(10, 186, 181, 0.4) 50%,
        rgba(10, 186, 181, 0.2) 80%,
        transparent
    );
    animation: headerGlow 4s ease-in-out infinite alternate;
}

@keyframes headerGlow {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 36px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
    transition: all var(--transition);
}

.app-brand:hover {
    filter: drop-shadow(0 0 8px rgba(10, 186, 181, 0.3));
}

.app-brand img {
    height: 34px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: all var(--transition);
    filter: drop-shadow(0 0 6px rgba(10, 186, 181, 0.2));
}

.app-brand:hover img {
    filter: drop-shadow(0 0 12px rgba(10, 186, 181, 0.4));
    transform: scale(1.05);
}

.app-brand i {
    color: var(--accent-light);
    font-size: 22px;
    animation: iconPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(10, 186, 181, 0.3));
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(10, 186, 181, 0.3)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(10, 186, 181, 0.5)); }
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 520;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width var(--transition);
    box-shadow: 0 0 8px var(--accent-glow);
}

.nav-link:hover {
    color: var(--text);
    background: rgba(10, 186, 181, 0.06);
}

.nav-link:hover::after {
    width: 60%;
}

.nav-link.active {
    color: var(--accent-light);
    background: rgba(10, 186, 181, 0.1);
}

.nav-link.active::after {
    width: 70%;
    background: var(--accent-light);
}

.nav-link i {
    transition: transform var(--transition);
}

.nav-link:hover i {
    transform: scale(1.15);
}

/* ---- LOGIN DROPDOWN ---- */
#loginTrigger {
    position: relative;
}

.login-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 310px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.97);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 200;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.login-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.login-dropdown .form-group {
    margin-bottom: 14px;
}

.login-dropdown .form-input {
    padding: 11px 16px;
    font-size: 14px;
}

.login-dropdown .login-btn {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    margin-top: 6px;
}

.login-error {
    background: var(--danger-glow);
    border: 1px solid rgba(225, 112, 85, 0.3);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    margin-bottom: 14px;
    display: none;
    animation: shake 0.4s ease;
}

.login-error.show { display: block; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ---- USER MENU ---- */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 550;
    color: var(--success);
    text-shadow: 0 0 10px rgba(46, 216, 163, 0.3);
}

/* ---- PAGES ---- */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: pageIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.app-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 36px 60px;
}

/* ---- FORM ---- */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-input {
    width: 100%;
    padding: 13px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: all var(--transition);
    outline: none;
    backdrop-filter: blur(8px);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 0 20px rgba(10, 186, 181, 0.1);
}

.form-input::placeholder {
    color: var(--text-dim);
}

/* ---- TOOLBAR ---- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.toolbar h2 {
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, var(--text), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.folder-count {
    background: rgba(10, 186, 181, 0.1);
    color: var(--accent-light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(10, 186, 181, 0.15);
}

/* ---- SECTION DIVIDER ---- */
.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 44px 0 36px;
    position: relative;
}

.section-divider::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ---- PUBLIC LIST ---- */
.public-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.public-list-header h2 {
    font-size: 21px;
    font-weight: 650;
}

/* ---- FOLDER GRID ---- */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

.folder-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: cardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animated gradient border overlay */
.folder-card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(
        var(--gradient-angle, 0deg),
        var(--accent) 0%,
        transparent 40%,
        transparent 60%,
        var(--accent-light) 100%
    );
    border-radius: calc(var(--radius) + 2px);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition);
    animation: rotateBorder 6s linear infinite;
}

@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    to { --gradient-angle: 360deg; }
}

/* Top accent bar */
.folder-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright), var(--accent-light));
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity var(--transition);
    animation: shimmerBar 3s ease infinite;
}

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

.folder-card:hover {
    border-color: rgba(10, 186, 181, 0.3);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.folder-card:hover::before { opacity: 0.4; }
.folder-card:hover::after { opacity: 1; }

.folder-card-link {
    text-decoration: none;
    color: inherit;
}

.folder-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.folder-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 620;
    flex: 1;
    min-width: 0;
}

.folder-card-title i {
    color: var(--accent-light);
    font-size: 20px;
    flex-shrink: 0;
    animation: iconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(10, 186, 181, 0.3));
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.folder-card-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: all var(--transition);
    flex-shrink: 0;
    transform: translateX(8px);
}

.folder-card:hover .folder-card-actions {
    opacity: 1;
    transform: translateX(0);
}

.folder-card-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--text-muted);
    font-size: 13px;
}

.folder-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.folder-badges {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    transition: all var(--transition);
}



.badge-private {
    background: rgba(136, 136, 160, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-listed {
    background: rgba(240, 199, 94, 0.1);
    color: var(--warning);
    border: 1px solid rgba(240, 199, 94, 0.25);
    box-shadow: 0 0 12px rgba(240, 199, 94, 0.08);
}

/* ---- STAGGERED CARD ANIMATIONS ---- */
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.folder-card:nth-child(1) { animation-delay: 0.00s; }
.folder-card:nth-child(2) { animation-delay: 0.06s; }
.folder-card:nth-child(3) { animation-delay: 0.12s; }
.folder-card:nth-child(4) { animation-delay: 0.18s; }
.folder-card:nth-child(5) { animation-delay: 0.24s; }
.folder-card:nth-child(6) { animation-delay: 0.30s; }
.folder-card:nth-child(7) { animation-delay: 0.36s; }
.folder-card:nth-child(8) { animation-delay: 0.42s; }
.folder-card:nth-child(9) { animation-delay: 0.48s; }
.folder-card:nth-child(10) { animation-delay: 0.54s; }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 90px 20px;
    color: var(--text-dim);
}

.empty-state i {
    font-size: 52px;
    margin-bottom: 18px;
    opacity: 0.4;
    animation: iconPulse 3s ease-in-out infinite;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 26px;
    color: var(--text-muted);
}

/* ---- MODAL (Glassmorphism) ---- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.92) translateY(16px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 30px 0;
}

.modal-header h3 {
    font-size: 19px;
    font-weight: 650;
}

.modal-body {
    padding: 26px 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 30px 26px;
}

/* ---- FOLDER DETAIL ---- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 520;
    margin-bottom: 26px;
    transition: all var(--transition);
    cursor: pointer;
}

.back-link:hover {
    color: var(--accent-light);
    transform: translateX(-4px);
}

.back-link i {
    transition: transform var(--transition);
}

.back-link:hover i {
    transform: translateX(-3px);
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 34px;
    gap: 24px;
    flex-wrap: wrap;
}

.detail-info h1 {
    font-size: 30px;
    font-weight: 750;
    letter-spacing: -0.6px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--text-muted);
    font-size: 13px;
    flex-wrap: wrap;
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Permalink & QR section */
.permalink-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition);
}

.permalink-section:hover {
    border-color: var(--border-light);
    box-shadow: 0 0 30px rgba(10, 186, 181, 0.06);
}

.permalink-url {
    flex: 1;
    min-width: 200px;
}

.permalink-url label {
    display: block;
    font-size: 11px;
    font-weight: 650;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}

.permalink-input-wrapper {
    display: flex;
    gap: 8px;
}

.permalink-input {
    flex: 1;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent-light);
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 13px;
    outline: none;
    cursor: text;
    transition: all var(--transition);
}

.permalink-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.permalink-qr {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 6px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition);
}

.permalink-qr:hover {
    transform: scale(1.08);
}

.permalink-qr canvas,
.permalink-qr img {
    width: 100% !important;
    height: 100% !important;
}

.copy-toast {
    position: fixed;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, var(--success), #5ce0bd);
    color: #fff;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 550;
    box-shadow: 0 6px 30px var(--success-glow);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    pointer-events: none;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- DROPZONE (Animated border) ---- */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 52px 28px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 26px;
    position: relative;
    overflow: hidden;
    background: rgba(10, 186, 181, 0.02);
}

.dropzone::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: radial-gradient(circle, rgba(10, 186, 181, 0.08), transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.dropzone:hover::before,
.dropzone.dragover::before {
    width: 400px;
    height: 400px;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: rgba(10, 186, 181, 0.04);
    box-shadow: 0 0 40px rgba(10, 186, 181, 0.08);
}

.dropzone.dragover {
    border-color: var(--accent-bright);
    background: rgba(10, 186, 181, 0.08);
    transform: scale(1.015);
    border-style: solid;
    box-shadow: 0 0 60px rgba(10, 186, 181, 0.15), inset 0 0 40px rgba(10, 186, 181, 0.05);
}

.dropzone-icon {
    font-size: 44px;
    color: var(--text-dim);
    margin-bottom: 14px;
    transition: all var(--transition);
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
    color: var(--accent-light);
    transform: scale(1.15);
    filter: drop-shadow(0 0 10px rgba(10, 186, 181, 0.4));
    animation: iconFloat 1.5s ease-in-out infinite;
}

.dropzone p {
    color: var(--text-muted);
    font-size: 15px;
    position: relative;
    z-index: 1;
}

.dropzone p strong {
    color: var(--accent-light);
}

.dropzone small {
    display: block;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

.dropzone input[type="file"] {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    cursor: pointer;
}

/* Upload progress (animated gradient) */
.upload-progress {
    margin-bottom: 26px;
    display: none;
}

.upload-progress.active { display: block; }

.progress-bar-wrapper {
    background: var(--bg-surface);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright), var(--accent-light), var(--accent));
    background-size: 300% 100%;
    border-radius: 20px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressShimmer 2s linear infinite;
    box-shadow: 0 0 10px var(--accent-glow);
}

@keyframes progressShimmer {
    0% { background-position: 0% 0; }
    100% { background-position: 300% 0; }
}

.progress-text {
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* ---- FILE GRID ---- */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 16px;
}

.file-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
    opacity: 0;
    animation: cardIn 0.4s ease forwards;
}

.file-card:nth-child(1) { animation-delay: 0.00s; }
.file-card:nth-child(2) { animation-delay: 0.04s; }
.file-card:nth-child(3) { animation-delay: 0.08s; }
.file-card:nth-child(4) { animation-delay: 0.12s; }
.file-card:nth-child(5) { animation-delay: 0.16s; }
.file-card:nth-child(6) { animation-delay: 0.20s; }
.file-card:nth-child(7) { animation-delay: 0.24s; }
.file-card:nth-child(8) { animation-delay: 0.28s; }
.file-card:nth-child(9) { animation-delay: 0.32s; }
.file-card:nth-child(10) { animation-delay: 0.36s; }

.file-card:hover {
    border-color: rgba(10, 186, 181, 0.25);
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow), 0 0 30px rgba(10, 186, 181, 0.08);
}

.file-preview {
    height: 145px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-surface);
    transition: all var(--transition-slow);
    position: relative;
}

.file-card:hover .file-preview {
    filter: brightness(1.05);
}

.file-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, var(--bg-card-solid), transparent);
    opacity: 0.7;
}

.file-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview-icon i {
    font-size: 42px;
    color: var(--text-dim);
    transition: all var(--transition);
}

.file-card:hover .file-preview-icon i {
    color: var(--accent-light);
    filter: drop-shadow(0 0 8px rgba(10, 186, 181, 0.3));
    transform: scale(1.08);
}

.file-info {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    font-size: 13.5px;
    font-weight: 550;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.file-download-btn {
    position: static;
    margin: 0;
    opacity: 1;
    background: rgba(6, 11, 12, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text) !important;
    border: 1px solid var(--glass-border) !important;
    transition: all var(--transition);
}

.file-download-btn:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}


/* ---- DOWNLOAD ALL SECTION ---- */
.download-all-section {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.download-all-section .btn {
    padding: 15px 36px;
    font-size: 15px;
}

/* ---- VISIBILITY TOGGLES ---- */
.visibility-toggles {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition);
}

.toggle-group:hover {
    border-color: var(--border-light);
}

.toggle-group label {
    font-size: 13px;
    font-weight: 520;
    color: var(--text-muted);
    cursor: pointer;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border-radius: 24px;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    transition: all var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.toggle input:checked + .toggle-slider::before {
    left: 22px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ---- ADD CONTENT SECTION ---- */
.add-content-section {
    margin-bottom: 24px;
}

.add-url-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 0;
}

.add-url-header {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.url-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.url-input-row .form-input {
    flex: 1;
}

.url-input-row .form-input:first-child {
    flex: 2;
}

.content-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.85em;
}

.content-divider::before,
.content-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- URL CARD ---- */
.url-card {
    border-color: rgba(99, 102, 241, 0.3) !important;
}

/* .url-preview no longer used — replaced by .url-thumb-section + .url-bottom */

/* url-qr-container base — overridden in .url-bottom context */

.url-label {
    color: var(--accent) !important;
    font-size: 0.8em !important;
    opacity: 0.8;
}

/* ---- IMAGE CARD ---- */
.image-card .image-preview {
    height: 180px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-card .image-preview:hover {
    transform: scale(1.03);
}

/* ---- LIGHTBOX ---- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---- RESPONSIVE ADD CONTENT ---- */
@media (max-width: 600px) {
    .url-input-row {
        flex-direction: column;
    }
    .url-input-row .form-input:first-child {
        flex: 1;
    }
}

/* ---- MEDIA CARDS (wide layout) ---- */
.media-card-wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.media-card-wide .media-player-container {
    grid-column: 1 / -1;
    grid-row: 1;
}

.media-card-wide .file-info {
    grid-column: 1;
    grid-row: 2;
    padding: 12px 16px;
}

.media-card-wide .file-download-btn {
    grid-row: 2;
    align-self: center;
    padding-right: 12px;
}

/* URL card wide override */
.url-card.media-card-wide {
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
}

/* ---- VIDEO PLAYER ---- */
.video-card {
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.media-video {
    width: 100%;
    max-height: 400px;
    display: block;
    background: #000;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ---- AUDIO PLAYER ---- */
.audio-card {
    border-color: rgba(236, 72, 153, 0.3) !important;
}

.audio-player-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(139, 92, 246, 0.08));
}

.audio-icon {
    font-size: 2rem;
    color: rgba(236, 72, 153, 0.7);
    flex-shrink: 0;
}

.media-audio {
    width: 100%;
    height: 40px;
    border-radius: 20px;
}

.media-audio::-webkit-media-controls-panel {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
}

/* ---- PDF VIEWER ---- */
.pdf-card {
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.pdf-container {
    position: relative;
    background: #525659;
}

.media-pdf {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ---- OFFICE VIEWER ---- */
.office-card {
    border-color: rgba(59, 130, 246, 0.3) !important;
}

.office-container {
    position: relative;
    background: #f0f0f0;
}

.media-office {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ---- RESPONSIVE MEDIA ---- */
@media (max-width: 600px) {
    .media-video {
        max-height: 250px;
    }
    .media-pdf,
    .media-office {
        height: 350px;
    }
    .audio-player-container {
        flex-direction: column;
        padding: 16px;
    }
    .url-card.media-card-wide .url-content {
        flex-wrap: wrap;
    }
}

/* ---- ABOUT PAGE ---- */
.about-container {
    max-width: 920px;
    margin: 0 auto;
}

.about-hero {
    text-align: center;
    padding: 56px 20px 48px;
}

.about-icon {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, var(--accent), var(--accent-bright), var(--accent-light));
    background-size: 200% 200%;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: #fff;
    margin-bottom: 24px;
    box-shadow: 0 8px 40px var(--accent-glow-strong);
    animation: iconGradient 4s ease infinite, aboutIconFloat 3s ease-in-out infinite;
    position: relative;
}

.about-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, var(--accent), transparent, var(--accent-light));
    border-radius: 28px;
    z-index: -1;
    opacity: 0.4;
    filter: blur(12px);
    animation: iconGradient 4s ease infinite;
}

@keyframes iconGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.about-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: brightness(1.1) drop-shadow(0 0 8px rgba(10, 186, 181, 0.3));
}

/* ---- BACKGROUND ANIMATION ---- */
.bg-animation {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background:
        radial-gradient(ellipse at 25% 25%, rgba(10, 186, 181, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 75%, rgba(129, 216, 208, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 10%, rgba(0, 240, 233, 0.04) 0%, transparent 40%);
    animation: bgDrift 20s ease-in-out infinite alternate;
}

@keyframes bgDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -3%) rotate(1deg); }
    66% { transform: translate(-2%, 2%) rotate(-1deg); }
    100% { transform: translate(1%, -1%) rotate(0.5deg); }
}

@keyframes aboutIconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(2deg); }
}

.about-hero h1 {
    font-size: 40px;
    font-weight: 750;
    letter-spacing: -1.2px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    margin-bottom: 52px;
}

.about-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 26px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: cardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animated background glow for about cards */
.about-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(10, 186, 181, 0.04), transparent 50%);
    transform: rotate(0deg);
    transition: all 0.6s ease;
    pointer-events: none;
}

.about-card:hover::before {
    transform: rotate(90deg);
    background: radial-gradient(circle at center, rgba(10, 186, 181, 0.08), transparent 50%);
}

.about-card:hover {
    border-color: rgba(10, 186, 181, 0.25);
    transform: translateY(-5px);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.about-card:nth-child(1) { animation-delay: 0.05s; }
.about-card:nth-child(2) { animation-delay: 0.12s; }
.about-card:nth-child(3) { animation-delay: 0.19s; }
.about-card:nth-child(4) { animation-delay: 0.26s; }
.about-card:nth-child(5) { animation-delay: 0.33s; }
.about-card:nth-child(6) { animation-delay: 0.40s; }

.about-card-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(10, 186, 181, 0.12), rgba(129, 216, 208, 0.08));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-light);
    margin-bottom: 18px;
    position: relative;
    transition: all var(--transition);
    border: 1px solid rgba(10, 186, 181, 0.1);
}

.about-card:hover .about-card-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 0 20px rgba(10, 186, 181, 0.2);
    background: linear-gradient(135deg, rgba(10, 186, 181, 0.2), rgba(129, 216, 208, 0.15));
}

.about-card:hover .about-card-icon i {
    filter: drop-shadow(0 0 8px rgba(10, 186, 181, 0.4));
}

.about-card h3 {
    font-size: 17px;
    font-weight: 640;
    margin-bottom: 10px;
}

.about-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

.about-footer {
    text-align: center;
    padding: 36px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 14px;
    position: relative;
}

.about-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ---- SHARE PAGE ---- */
.share-page .share-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 36px;
    position: relative;
    z-index: 1;
}

.share-error {
    text-align: center;
    padding: 90px 20px;
}

.share-error .error-icon {
    font-size: 60px;
    color: var(--danger);
    margin-bottom: 22px;
    animation: iconPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 16px rgba(225, 112, 85, 0.3));
}

.share-error h1 {
    font-size: 30px;
    margin-bottom: 10px;
    font-weight: 700;
}

.share-error p {
    color: var(--text-muted);
    margin-bottom: 36px;
    font-size: 16px;
}

.share-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
    flex-wrap: wrap;
}

.share-brand {
    margin-bottom: 22px;
    width: 100%;
}

.brand-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.brand-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 520;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.brand-link:hover {
    color: var(--accent-light);
    text-shadow: 0 0 10px rgba(10, 186, 181, 0.3);
}

.share-title-block h1 {
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -0.6px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text) 50%, var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.share-title-block h1 i {
    -webkit-text-fill-color: var(--accent-light);
    filter: drop-shadow(0 0 6px rgba(10, 186, 181, 0.3));
}

.share-meta {
    display: flex;
    gap: 18px;
    color: var(--text-muted);
    font-size: 13px;
}

.share-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-download-all {
    flex-shrink: 0;
}

.share-files {
    margin-top: 10px;
}

/* ---- ANIMATIONS ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-bright);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    filter: drop-shadow(0 0 4px rgba(10, 186, 181, 0.2));
}

/* ---- CONFIRM DIALOG ---- */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.confirm-overlay.active { opacity: 1; visibility: visible; }

.confirm-box {
    background: var(--bg-card-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.confirm-overlay.active .confirm-box {
    transform: scale(1);
}

.confirm-box p {
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.6;
}

.confirm-box .confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ---- SELECTION ---- */
::selection {
    background: rgba(10, 186, 181, 0.25);
    color: var(--text);
}

/* ---- FOCUS VISIBLE ---- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .app-header {
        padding: 0 18px;
        height: 58px;
    }
    .header-left { gap: 18px; }
    .header-nav { gap: 2px; }
    .nav-link {
        padding: 7px 10px;
        font-size: 12.5px;
    }
    .nav-link i { display: none; }
    .nav-link::after { display: none; }
    .app-content { padding: 22px 18px 50px; }
    .folder-grid { grid-template-columns: 1fr; }
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
    .detail-header { flex-direction: column; }
    .permalink-section { flex-direction: column; }
    .permalink-qr { align-self: center; }
    .toolbar { flex-direction: column; align-items: flex-start; }
    .folder-card-actions { opacity: 1; transform: translateX(0); }
    .file-download-btn, .file-delete-btn { opacity: 1; transform: translateY(0); }
    .share-header { flex-direction: column; }
    .about-hero h1 { font-size: 30px; }
    .about-grid { grid-template-columns: 1fr; }
    .login-dropdown { width: 285px; right: -8px; }
    .detail-info h1 { font-size: 24px; }

    .app-brand img {
        height: 28px;
    }
}

@media (max-width: 480px) {
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
    .detail-info h1 { font-size: 22px; }
    .detail-actions { width: 100%; }
    .detail-actions .btn { flex: 1; justify-content: center; }
    .app-brand { font-size: 16px; }
    .app-brand i { font-size: 18px; }
    .login-dropdown { width: 260px; }
    .about-hero { padding: 36px 16px 32px; }
    .about-hero h1 { font-size: 26px; }
    .about-subtitle { font-size: 15px; }

    .app-brand img {
        height: 24px;
    }
}

/* ---- USERS PAGE ---- */
.users-container {
    max-width: 700px;
    margin: 0 auto;
}

.users-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: background 0.2s;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-card-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.user-card-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
    min-width: 120px;
}

.user-card-name i:first-child {
    color: #0abab5;
}

.user-card-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.user-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.badge-admin {
    background: rgba(10, 186, 181, 0.15);
    color: #0abab5;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-user {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---- CHECKBOX LABEL ---- */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0abab5;
    cursor: pointer;
}

/* ---- URL CARD — screenshot as background ---- */

/* Card with background screenshot */
.url-card.has-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Dark overlay so text is readable */
.url-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 15, 30, 0.45) 0%,
        rgba(10, 15, 30, 0.85) 100%
    );
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
}

/* Content on top of overlay */
.url-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

/* QR box */
.url-qr-box {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.url-qr-box img {
    display: block;
    border-radius: 4px;
}

/* Text block */
.url-info-block {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.url-info-block .file-name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.has-bg .url-info-block .url-label {
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.url-info-block .url-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Make has-bg cards taller for the screenshot to be visible */
.url-card.has-bg.media-card-wide {
    min-height: 130px;
}

/* URL card buttons always visible and properly positioned */
.url-card .file-download-btn {
    position: static;
    opacity: 1;
    transform: none;
    flex-shrink: 0;
    z-index: 3;
}

/* Make title clickable too */
.url-info-block .file-name {
    cursor: pointer;
}

.url-info-block .file-name:hover {
    color: var(--accent-light);
}

/* Entire url-card clickable as <a> tag */
a.url-card {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
}

a.url-card:hover {
    color: inherit;
}

/* ---- PIN GATE ---- */
.pin-gate-container {
    max-width: 400px;
    margin: 60px auto;
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.pin-gate-icon {
    font-size: 3rem;
    color: #0abab5;
    margin-bottom: 16px;
}

.pin-gate-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.pin-gate-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.pin-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    max-width: 200px;
    margin: 0 auto;
    font-weight: 700;
}

/* ---- PIN SETTINGS ---- */
.pin-setting {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 12px;
}

.pin-setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.pin-setting-row label {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pin-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-left: auto;
}

.pin-status.pin-active {
    color: #0abab5;
    font-weight: 600;
}

.pin-setting-input {
    max-width: 180px;
    text-align: center;
    letter-spacing: 0.3em;
    font-weight: 600;
}

/* ---- PIN BADGE ---- */
.badge-pin {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---- FILE ADMIN BUTTONS ---- */
.file-admin-btns {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 2px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 8px;
    padding: 3px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 5;
}

.file-card:hover .file-admin-btns {
    opacity: 1;
}

.file-card {
    position: relative;
}

.btn-xs {
    padding: 4px 6px;
    font-size: 0.7rem;
    min-width: auto;
    line-height: 1;
}

.btn-danger-text {
    color: #f87171;
}

.btn-danger-text:hover {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.15);
}

/* ---- POSITION BADGE ---- */
.position-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(10, 186, 181, 0.9);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    line-height: 1;
}

/* ---- PREFERS REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
