/* ========================================================
   FemboyPIC — Designer Dark Aesthetics
   Typography: Inter
   ======================================================== */

:root {
    --bg-base: #09080e;
    --bg-surface: #12101b;
    --bg-surface-elevated: #1a1726;
    --bg-surface-hover: #221f32;

    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-highlight: rgba(244, 63, 94, 0.4);
    --border-card: rgba(255, 255, 255, 0.06);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    --rose-500: #f43f5e;
    --rose-400: #fb7185;
    --fuchsia-500: #d946ef;
    --purple-500: #a855f7;

    --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #d946ef 60%, #a855f7 100%);
    --accent-subtle: rgba(244, 63, 94, 0.12);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px rgba(244, 63, 94, 0.25);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: #232034;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #34304c;
}

/* ========================================================
   Navbar
   ======================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(9, 8, 14, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.logo-accent {
    color: var(--rose-400);
}

/* Minimalist Storage Meter */
.storage-meter {
    flex: 1;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.storage-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.storage-title {
    font-weight: 500;
}

.storage-val {
    font-weight: 600;
    color: var(--text-secondary);
}

.storage-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
    filter: brightness(1.06);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.btn-danger-ghost {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: #f87171;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
}

/* ========================================================
   Intro Section
   ======================================================== */
.intro-section {
    padding: 3rem 1.75rem 1.5rem;
    text-align: center;
}

.intro-wrap {
    max-width: 680px;
    margin: 0 auto;
}

.intro-headline {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.intro-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.feature-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.pill {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.35rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.pill i {
    color: var(--rose-400);
}

/* ========================================================
   Main Container & Filter Bar
   ======================================================== */
.main-container {
    flex: 1;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1.75rem 4rem;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 3px;
    border-radius: var(--radius-md);
    gap: 3px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--bg-surface-elevated);
    color: var(--rose-400);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.counter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* ========================================================
   Gallery Grid & Cards
   ======================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.media-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s var(--ease-out), border-color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    position: relative;
}

.media-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-card);
}

.card-media-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #0f0d16;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease-out);
}

.media-card:hover .card-img {
    transform: scale(1.03);
}

.badge-format {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(9, 8, 14, 0.75);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-owner {
    position: absolute;
    top: 8px;
    left: calc(8px + 65px);
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(244, 63, 94, 0.8);
    backdrop-filter: blur(6px);
    color: #ffffff;
}

.badge-expiry {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(9, 8, 14, 0.75);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-subtle);
    color: var(--rose-400);
}

.video-glyph {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(244, 63, 94, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.card-meta {
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.card-savings {
    color: #34d399;
    font-weight: 600;
}

/* Skeleton Loading */
.card-skeleton {
    aspect-ratio: 4 / 3.8;
    background: linear-gradient(90deg, #13111c 25%, #1a1727 50%, #13111c 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-lg);
    animation: skeleton-pulse 1.6s infinite;
}

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

/* Empty State */
.empty-feed {
    text-align: center;
    padding: 4.5rem 1.5rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: 520px;
    margin: 2rem auto;
}

.empty-icon-wrap {
    font-size: 2.8rem;
    color: var(--rose-400);
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.empty-title {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.empty-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

/* ========================================================
   Modals
   ======================================================== */
.modal-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-layer.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 4, 8, 0.85);
    backdrop-filter: blur(12px);
}

.modal-window {
    position: relative;
    z-index: 10;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: modal-pop 0.25s var(--ease-out);
}

.modal-wide {
    max-width: 820px;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-top {
    padding: 1.15rem 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-heading h2 {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-icon {
    color: var(--rose-400);
}

.modal-dismiss {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.modal-dismiss:hover {
    color: #ffffff;
}

.modal-form {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.input-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-block label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-block input {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-block input:focus {
    border-color: var(--rose-400);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

/* Drop Area */
.drop-area {
    border: 2px dashed rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.02);
    border-radius: var(--radius-md);
    padding: 2.2rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.drop-area:hover, .drop-area.dragover {
    border-color: var(--rose-400);
    background: rgba(244, 63, 94, 0.06);
}

.sr-hidden {
    display: none;
}

.drop-icon {
    font-size: 2.2rem;
    color: var(--rose-400);
    margin-bottom: 0.65rem;
}

.drop-main-text {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.drop-main-text span {
    color: var(--rose-400);
    text-decoration: underline;
}

.drop-sub-text {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.file-chosen {
    margin-top: 0.85rem;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-chosen.hidden {
    display: none;
}

.file-chosen-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    max-width: 280px;
}

.file-name-text {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size-text {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
}

.btn-clear:hover {
    color: #f87171;
}

/* Progress */
.upload-progress-box {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.upload-progress-box.hidden {
    display: none;
}

.upload-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-indicator {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.modal-bottom {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

/* ========================================================
   Viewer Modal
   ======================================================== */
.viewer-content {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow-y: auto;
}

.viewer-headline {
    font-size: 1.05rem;
    font-weight: 700;
}

.type-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.media-stage {
    background: #06050a;
    min-height: 300px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-stage img,
.media-stage video {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.media-details-sidebar {
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.input-with-action {
    display: flex;
    gap: 0.5rem;
}

.input-with-action input {
    flex: 1;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.8rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    background: var(--bg-surface-elevated);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.info-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-caption {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.info-data {
    font-size: 0.82rem;
    font-weight: 600;
}

.text-accent {
    color: #34d399;
}

.text-warn {
    color: #fbbf24;
}

.action-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.35rem;
}

/* ========================================================
   Toast Stack
   ======================================================== */
.toast-stack {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--rose-400);
    padding: 0.75rem 1.15rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.82rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: toast-fly 0.25s var(--ease-out);
}

.toast.toast-success {
    border-left-color: #10b981;
}

.toast.toast-error {
    border-left-color: #ef4444;
}

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

/* ========================================================
   Footer
   ======================================================== */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 1.25rem 1.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: auto;
}

.footer-wrap {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-copy strong {
    color: var(--rose-400);
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }
    .storage-meter {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .intro-headline {
        font-size: 1.6rem;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.85rem;
    }
}
