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

* {
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
    display: none;
    width: 0px;
    height: 0px;
    background: transparent;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Glass */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.05), 0 2px 8px -1px rgba(0, 0, 0, 0.03);
}

.dark .glass-panel {
    background: rgba(18, 18, 24, 0.82);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.12);
}

.dark .glass-modal {
    background: rgba(18, 18, 22, 0.96);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -4px 60px rgba(0, 0, 0, 0.7);
}

/* Header & Brand Styles */
.btn-back {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1.5px solid rgba(0, 0, 0, 0.22);
    color: #1f2937;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 18px;
}

.dark .btn-back {
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: #f4f4f5;
}

.btn-back:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
    transform: translateX(-2px);
    border-color: rgba(0, 0, 0, 0.45);
}

.dark .btn-back:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.42);
}

.btn-back:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.55);
    opacity: 0.85;
}

.dark .btn-back:active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.6);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s ease;
}

.brand-link:hover {
    opacity: 0.92;
}

.brand-logo-card {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    padding: 3.5px;
    box-sizing: border-box;
    transition: transform 0.2s ease;
}

.dark .brand-logo-card {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-link:hover .brand-logo-card {
    transform: scale(1.04);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.brand-text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1;
    white-space: nowrap;
}

.brand-name {
    font-weight: 800;
    font-size: 19px;
    color: #111827;
    letter-spacing: -0.025em;
    line-height: 1;
}

.dark .brand-name {
    color: #ffffff;
}

.brand-divider {
    font-size: 14px;
    font-weight: 300;
    color: #9ca3af;
    opacity: 0.7;
}

.dark .brand-divider {
    color: #52525b;
    opacity: 0.85;
}

.brand-app {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    letter-spacing: -0.01em;
}

.dark .brand-app {
    color: #a1a1aa;
}

@media (max-width: 640px) {
    .btn-back {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 16px;
    }
    .brand-logo-card {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        padding: 3px;
    }
    .brand-name {
        font-size: 17px;
    }
    .brand-app {
        font-size: 13px;
    }
}

/* Card themes */
.theme-blue {
    --tc: 59, 130, 246;
}

.theme-yellow {
    --tc: 234, 179, 8;
}

.theme-pink {
    --tc: 236, 72, 153;
}

.card-item {
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
    cursor: pointer;
}

.dark .card-item {
    background: rgba(24, 24, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--tc), 0.07) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.dark .card-item::before {
    background: linear-gradient(135deg, rgba(var(--tc), 0.14) 0%, transparent 65%);
}

.card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px -8px rgba(var(--tc), 0.18);
    border-color: rgba(var(--tc), 0.25);
}

.dark .card-item:hover {
    background: rgba(28, 28, 34, 0.92);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -8px rgba(var(--tc), 0.32), 0 0 0 1px rgba(var(--tc), 0.2);
    border-color: rgba(var(--tc), 0.45);
}

.card-item:hover::before {
    opacity: 1;
}

.card-item:active {
    transform: scale(0.97);
}

.card-content {
    position: relative;
    z-index: 2;
}

/* FAB */
.fab {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 20px);
    right: 20px;
    z-index: 50;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.fab:active {
    transform: scale(0.92);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dark .fab {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Bottom sheet */
.sheet-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    border-radius: 28px 28px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sheet-panel.open {
    transform: translateY(0);
}

/* Sheet handle */
.sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.12);
    margin: 12px auto 0;
}

.dark .sheet-handle {
    background: rgba(255, 255, 255, 0.15);
}

/* Share modal */
.share-overlay-content {
    transform: scale(0.88) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.share-overlay-content.open {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Poster */
.poster-wrapper {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.dark .poster-wrapper {
    background: #18181b;
}

.poster-glow {
    position: absolute;
    width: 160%;
    height: 160%;
    top: -30%;
    left: -30%;
    background: conic-gradient(from 180deg at 50% 50%, rgba(var(--tc), 0.3) 0deg, transparent 60deg, transparent 300deg, rgba(var(--tc), 0.3) 360deg);
    animation: rotateGlow 10s linear infinite;
    filter: blur(50px);
    opacity: 0.7;
}

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

/* Press effect */
.btn-press:active {
    transform: scale(0.93);
    transition: transform 0.1s;
}

/* Sortable */
.sortable-ghost {
    opacity: 0.25;
}

.sortable-drag {
    transform: scale(1.04) rotate(1.5deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 99;
}

/* Input */
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    cursor: pointer;
}

.dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.55;
}

/* Noise */
.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.dark .noise-overlay {
    opacity: 0.05;
    mix-blend-mode: overlay;
}

/* Overlay backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

/* ==========================================================================
   Sync Status & User Profile Button Styles
   ========================================================================== */
.sync-status-btn {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    color: #64748b;
    flex-shrink: 0;
}

.dark .sync-status-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #a1a1aa;
}

.sync-status-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.sync-status-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.04);
}

.dark .sync-status-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.sync-status-btn:active {
    transform: scale(0.92);
}

.sync-status-btn.synced {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #10b981;
}

.dark .sync-status-btn.synced {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.sync-status-btn.syncing {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: #3b82f6;
}

.dark .sync-status-btn.syncing {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.sync-status-btn.dirty {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #f59e0b;
}

.dark .sync-status-btn.dirty {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.sync-status-btn.offline {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.dark .sync-status-btn.offline {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #71717a;
}

.sync-status-btn .spin {
    animation: spinSync 1s linear infinite;
}

@keyframes spinSync {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.user-header-btn {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.dark .user-header-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.user-header-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    transform: scale(1.04);
}

.dark .user-header-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.user-header-btn:active {
    transform: scale(0.92);
}

.user-avatar-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    overflow: hidden;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-default-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
}

.dark .user-default-icon {
    color: #a1a1aa;
}

.user-initial-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .sync-status-btn,
    .user-header-btn {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }
    .sync-status-btn svg,
    .user-default-icon {
        width: 16px;
        height: 16px;
    }
}