/* 
 * Links Startside - Apple Design Language
 * Inspirert av macOS Launchpad, iOS Home Screen & Spotlight
 * 
 * Note: Inter font is loaded via preconnect in HTML for better performance
 */

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

:root {
    /* Base Colors - Default Theme (Aurora) */
    --bg-base: #000000;
    --bg-elevated: rgba(28, 28, 30, 0.72);
    --bg-secondary: rgba(44, 44, 46, 0.65);
    --bg-tertiary: rgba(58, 58, 60, 0.50);
    --bg-quaternary: rgba(72, 72, 74, 0.40);
    
    /* Vibrancy backgrounds */
    --vibrancy-dark: rgba(30, 30, 30, 0.78);
    --vibrancy-light: rgba(255, 255, 255, 0.12);
    --vibrancy-ultra: rgba(255, 255, 255, 0.06);
    
    /* Text */
    --label-primary: rgba(255, 255, 255, 1.0);
    --label-secondary: rgba(255, 255, 255, 0.60);
    --label-tertiary: rgba(255, 255, 255, 0.40);
    --label-quaternary: rgba(255, 255, 255, 0.24);
    
    /* System Colors */
    --system-blue: #0A84FF;
    --system-blue-light: #409CFF;
    --system-indigo: #5E5CE6;
    --system-purple: #BF5AF2;
    --system-pink: #FF375F;
    --system-red: #FF453A;
    --system-orange: #FF9F0A;
    --system-yellow: #FFD60A;
    --system-green: #30D158;
    --system-teal: #64D2FF;
    
    /* Fills & Strokes */
    --fill-primary: rgba(255, 255, 255, 0.18);
    --fill-secondary: rgba(255, 255, 255, 0.12);
    --fill-tertiary: rgba(255, 255, 255, 0.08);
    --separator: rgba(255, 255, 255, 0.12);
    
    /* Shadows */
    --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.32);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.48);
    --shadow-large: 0 16px 48px rgba(0, 0, 0, 0.56);
    
    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    /* Avatar Colors - For dark backgrounds */
    --avatar-color-1: #FF6B6B;
    --avatar-color-2: #4ECDC4;
    --avatar-color-3: #45B7D1;
    --avatar-color-4: #96CEB4;
    --avatar-color-5: #FFEAA7;
    --avatar-color-6: #DDA0DD;
    --avatar-color-7: #98D8C8;
    --avatar-color-8: #F7DC6F;
    --avatar-color-9: #BB8FCE;
    --avatar-color-10: #85C1E9;
    --avatar-color-11: #F8B500;
    --avatar-color-12: #00CED1;
    --avatar-color-13: #FF7F50;
    --avatar-color-14: #9FE2BF;
    --avatar-color-15: #DE3163;
    --avatar-text-color: rgba(0, 0, 0, 0.7);
    
    /* Theme Background (default: Aurora) */
    --theme-bg: 
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(120, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(0, 100, 255, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 60% at 60% 80%, rgba(255, 50, 100, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
}

/* ==================== */
/* THEMES               */
/* ==================== */

/* Theme 1: Aurora (Default) - Blue/Purple gradient */
/* Already defined in :root */

/* Theme 2: Midnight - Pure dark */
body.theme-midnight {
    --theme-bg: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 50%, #0a0a0a 100%);
    --vibrancy-dark: rgba(20, 20, 20, 0.85);
    --system-blue: #0A84FF;
}

/* Theme 3: Ocean - Blue/Teal gradient */
body.theme-ocean {
    --theme-bg: 
        radial-gradient(ellipse 80% 60% at 30% 30%, rgba(0, 150, 180, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 70% 70%, rgba(0, 80, 120, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, #0c3547 0%, #1a5276 50%, #154360 100%);
    --vibrancy-dark: rgba(20, 60, 80, 0.78);
    --system-blue: #00BCD4;
    --system-blue-light: #4DD0E1;
}

/* Theme 4: Forest - Green gradient */
body.theme-forest {
    --theme-bg: 
        radial-gradient(ellipse 70% 50% at 25% 35%, rgba(34, 139, 34, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 75% 65%, rgba(0, 100, 0, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #1a2e1a 0%, #0d1f0d 50%, #0a1a0a 100%);
    --vibrancy-dark: rgba(20, 40, 20, 0.82);
    --system-blue: #4CAF50;
    --system-blue-light: #81C784;
    --system-green: #66BB6A;
}

/* Theme 5: Sunset - Orange/Pink/Purple gradient */
body.theme-sunset {
    --theme-bg: 
        radial-gradient(ellipse 80% 50% at 20% 30%, rgba(255, 100, 50, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(255, 50, 100, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 60% at 50% 80%, rgba(100, 0, 150, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #2d1f3d 0%, #1f1a2e 50%, #1a1520 100%);
    --vibrancy-dark: rgba(40, 25, 50, 0.8);
    --system-blue: #FF6B6B;
    --system-blue-light: #FF8E8E;
    --system-orange: #FFB347;
}

/* Theme 6: Light - Clean light theme */
body.theme-light {
    --theme-bg: linear-gradient(180deg, #f0f2f5 0%, #e8eaed 50%, #dfe1e5 100%);
    --bg-base: #f5f5f7;
    --bg-elevated: rgba(255, 255, 255, 0.9);
    --bg-secondary: rgba(0, 0, 0, 0.04);
    --bg-tertiary: rgba(0, 0, 0, 0.03);
    --vibrancy-dark: rgba(255, 255, 255, 0.92);
    --vibrancy-light: rgba(0, 0, 0, 0.06);
    --vibrancy-ultra: rgba(0, 0, 0, 0.03);
    --label-primary: rgba(0, 0, 0, 0.85);
    --label-secondary: rgba(0, 0, 0, 0.55);
    --label-tertiary: rgba(0, 0, 0, 0.35);
    --label-quaternary: rgba(0, 0, 0, 0.20);
    --fill-primary: rgba(0, 0, 0, 0.08);
    --fill-secondary: rgba(0, 0, 0, 0.05);
    --fill-tertiary: rgba(0, 0, 0, 0.03);
    --separator: rgba(0, 0, 0, 0.1);
    --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-large: 0 16px 48px rgba(0, 0, 0, 0.16);
    --system-blue: #007AFF;
    --system-blue-light: #3395FF;
    /* Avatar colors for light background */
    --avatar-color-1: #E74C3C;
    --avatar-color-2: #16A085;
    --avatar-color-3: #2980B9;
    --avatar-color-4: #27AE60;
    --avatar-color-5: #F39C12;
    --avatar-color-6: #8E44AD;
    --avatar-color-7: #1ABC9C;
    --avatar-color-8: #D68910;
    --avatar-color-9: #7D3C98;
    --avatar-color-10: #2E86AB;
    --avatar-color-11: #E67E22;
    --avatar-color-12: #17A2B8;
    --avatar-color-13: #C0392B;
    --avatar-color-14: #2ECC71;
    --avatar-color-15: #9B59B6;
    --avatar-text-color: rgba(255, 255, 255, 0.95);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    min-height: 100vh;
    color: var(--label-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--theme-bg);
    background-attachment: fixed;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 32px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== */
/* Spotlight-style Search */
/* ==================== */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 56px;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
}

.search-bar {
    width: 100%;
    padding: 16px 52px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--vibrancy-dark);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    color: var(--label-primary);
    font-size: 17px;
    font-family: inherit;
    font-weight: 400;
    letter-spacing: -0.01em;
    outline: none;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        var(--shadow-medium);
}

.search-bar:focus {
    background: rgba(40, 40, 45, 0.88);
    box-shadow: 
        0 0 0 4px rgba(10, 132, 255, 0.3),
        0 0 0 0.5px rgba(255, 255, 255, 0.15),
        var(--shadow-medium);
    transform: scale(1.01);
}

.search-bar::placeholder {
    color: var(--label-tertiary);
}

.google-logo {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    pointer-events: none;
    z-index: 10;
}

.google-logo path {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--label-tertiary);
    pointer-events: none;
    z-index: 10;
}

/* ==================== */
/* Launchpad Grid */
/* ==================== */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(8, 120px);
    grid-template-rows: repeat(6, 120px);
    gap: 12px;
    max-width: 1056px;
    margin: 0 auto;
    justify-content: center;
    padding: 24px;
    border-radius: var(--radius-xl);
    transition: background 0.3s ease;
}

/* Grid visible during drag */
.shortcuts-grid.dragging-active {
    background: var(--vibrancy-ultra);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.shortcuts-grid.dragging-active .grid-cell {
    background: var(--fill-tertiary);
    border-radius: var(--radius-md);
}

/* Grid Cell */
.grid-cell {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* .grid-cell-empty - no styles needed, receives drag events via .grid-cell */

.grid-cell.drag-over {
    background: rgba(10, 132, 255, 0.25);
    box-shadow: 0 0 0 2px var(--system-blue);
    transform: scale(1.02);
}

/* ==================== */
/* App Icon - iOS Style */
/* ==================== */
.shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--label-primary);
    position: relative;
    width: 112px;
    height: 112px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    -webkit-tap-highlight-color: transparent;
}

/* Dock-style magnification on hover */
.shortcut:hover {
    transform: scale(1.08);
    z-index: 10;
}

.shortcut:hover .shortcut-icon {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.shortcut:active {
    transform: scale(0.95);
    cursor: grabbing;
}

.shortcut:active .shortcut-icon {
    transform: translateY(0);
    filter: brightness(0.85);
}

.shortcut.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(1.1);
}

.shortcut.drag-over {
    transform: scale(1.12);
}

.shortcut.drag-over .shortcut-icon {
    box-shadow: 
        0 0 0 3px var(--system-blue),
        var(--shadow-medium);
}

.shortcut[draggable="true"] {
    cursor: pointer;
}

.shortcut[draggable="true"]:active {
    cursor: grabbing;
}

/* iOS App Icon */
.shortcut-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    background: var(--fill-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.shortcut-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.shortcut-icon .icon-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--label-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* App Label */
.shortcut-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--label-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.01em;
}

/* Folder count badge - top right corner */
.folder-shortcut {
    position: relative;
}

.folder-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--system-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 5;
}


/* ==================== */
/* Add App Button */
/* ==================== */
.add-shortcut .shortcut-icon {
    background: var(--fill-tertiary);
    border: 2px dashed var(--label-quaternary);
    box-shadow: none;
}

.add-shortcut:hover .shortcut-icon {
    background: var(--fill-secondary);
    border-color: var(--system-blue);
    box-shadow: 0 0 20px rgba(10, 132, 255, 0.2);
}

.add-shortcut .icon-text {
    font-size: 28px;
    font-weight: 300;
    color: var(--label-tertiary);
    text-shadow: none;
}

.add-shortcut:hover .icon-text {
    color: var(--system-blue);
}

/* ==================== */
/* Folder - iOS Style */
/* ==================== */
.folder-shortcut {
    cursor: pointer;
}

.folder-shortcut:active {
    cursor: grabbing;
}

.folder-shortcut .shortcut-icon {
    width: 60px;
    height: 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
    padding: 5px;
    background: var(--vibrancy-dark);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border-radius: var(--radius-md);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.35),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.15);
}

/* Folder thumbnails - 4 små ikoner i 2x2 grid */
.folder-thumbnail {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 4px;
}

.folder-thumbnail-placeholder {
    width: 22px;
    height: 22px;
    background: var(--fill-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 7px;
    color: var(--label-quaternary);
}

/* ==================== */
/* Modal - iOS Sheet */
/* ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* Add/Edit modals always on top */
#addLinkModal,
#addFolderModal,
#editLinkModal,
#editFolderModal {
    z-index: 1100;
}

.modal.active {
    display: flex;
    animation: modalBackdropIn 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

.modal-content {
    background: var(--vibrancy-dark);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
    color: var(--label-primary);
    padding: 28px;
    border-radius: var(--radius-xl);
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        var(--shadow-large);
    animation: modalContentIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalContentIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h2 {
    margin: 0 0 24px 0;
    color: var(--label-primary);
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.02em;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--fill-secondary);
    border: none;
    font-size: 14px;
    color: var(--label-secondary);
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all 0.15s ease;
    line-height: 1;
}

.modal-close:hover {
    background: var(--fill-primary);
    color: var(--label-primary);
    transform: scale(1.05);
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: var(--fill-tertiary);
    color: var(--label-primary);
    outline: none;
    transition: all 0.15s ease;
    -webkit-appearance: none;
}

.modal-content input:focus,
.modal-content select:focus {
    background: var(--fill-secondary);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.3);
}

.modal-content input::placeholder {
    color: var(--label-tertiary);
}

.modal-content .form-group {
    margin-bottom: 16px;
}

.modal-content .form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--label-secondary);
    margin-bottom: 8px;
}

/* Icon Grid Selector */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.icon-option {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--fill-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-option:hover {
    background: var(--fill-secondary);
    transform: scale(1.08);
}

.icon-option.active {
    background: var(--system-blue);
    border-color: var(--system-blue-light);
    box-shadow: 0 0 12px rgba(10, 132, 255, 0.4);
}

.modal-content select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.5' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.modal-content select option {
    background: #2c2c2e;
    color: var(--label-primary);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
}

/* ==================== */
/* Buttons - iOS Style */
/* ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.15s ease;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--system-blue);
    color: #ffffff;
    min-width: 120px;
}

.btn-primary:hover {
    background: var(--system-blue-light);
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(0.98);
    filter: brightness(0.9);
}

.btn-secondary {
    background: var(--fill-secondary);
    color: var(--system-blue);
}

.btn-secondary:hover {
    background: var(--fill-primary);
}

/* ==================== */
/* Context Menu - macOS Style */
/* ==================== */
.context-menu {
    position: fixed;
    background: var(--vibrancy-dark);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
    color: var(--label-primary);
    border-radius: var(--radius-sm);
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.15),
        var(--shadow-medium);
    padding: 6px;
    display: none;
    z-index: 10000;
    min-width: 220px;
}

.context-menu.active {
    display: block;
    animation: contextMenuIn 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes contextMenuIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius-xs);
    transition: background 0.1s ease;
}

.context-menu-item:hover {
    background: var(--system-blue);
}

.context-menu-item:active {
    filter: brightness(0.9);
}

.context-menu-item.delete {
    color: var(--system-red);
}

.context-menu-item.delete:hover {
    background: var(--system-red);
    color: #ffffff;
}

.context-menu-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0.8;
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 8px;
}

/* ==================== */
/* Folder Modal - iOS Folder Open */
/* ==================== */
#folderModal {
    background: rgba(0, 0, 0, 0.6);
}

.folder-modal-content {
    background: var(--vibrancy-dark);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
    color: var(--label-primary);
    padding: 28px;
    border-radius: var(--radius-xl);
    min-width: 200px;
    width: auto;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        var(--shadow-large);
    animation: folderOpen 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes folderOpen {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.folder-modal-header {
    padding: 0 0 20px 0;
    text-align: center;
}

.folder-modal-header h2 {
    margin: 0;
    color: var(--label-primary);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.editable-folder-title {
    cursor: text;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    display: inline-block;
}

.editable-folder-title:hover {
    background: var(--fill-secondary);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.3);
}

.folder-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--fill-secondary);
    border: none;
    font-size: 14px;
    color: var(--label-secondary);
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all 0.15s ease;
    line-height: 1;
}

.folder-modal-close:hover {
    background: var(--fill-primary);
    color: var(--label-primary);
    transform: scale(1.05);
}

.folder-modal-body {
    overflow: hidden;
    padding: 4px;
}

.folder-links-grid {
    display: grid;
    /* grid-template-columns set dynamically via JS */
    grid-auto-rows: 112px;
    gap: 12px;
    justify-content: center;
}

.folder-grid-cell.hidden-cell {
    display: none;
}

.folder-links-grid.dragging {
    grid-template-columns: repeat(7, 112px) !important;
    grid-template-rows: repeat(4, 112px);
}

.folder-links-grid.dragging .folder-grid-cell.hidden-cell,
.folder-links-grid.dragging .folder-grid-cell.was-hidden {
    display: flex;
}

.folder-links-grid.dragging .folder-grid-cell {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.folder-grid-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
}

.folder-grid-cell.drag-over {
    background: rgba(10, 132, 255, 0.25) !important;
    box-shadow: 0 0 0 2px var(--system-blue);
    transform: scale(1.02);
}

.folder-grid-cell .shortcut {
    width: auto;
    height: auto;
}

.folder-grid-cell .shortcut-icon {
    width: 60px;
    height: 60px;
}

/* Arver fra .shortcut-icon img */

.folder-grid-cell .shortcut-label {
    font-size: 11px;
}

.folder-grid-cell .shortcut {
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: element;
}

.folder-grid-cell .shortcut.dragging {
    opacity: 0.4;
}


.folder-links-grid .add-shortcut {
    opacity: 0.6;
}

.folder-links-grid .add-shortcut:hover {
    opacity: 1;
}

/* ==================== */
/* Scrollbar - macOS Style */
/* ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--fill-secondary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fill-primary);
}

/* ==================== */
/* Selection */
/* ==================== */
::selection {
    background: rgba(10, 132, 255, 0.4);
}

/* ==================== */
/* Shares List */
/* ==================== */
.shares-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--fill-tertiary);
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.share-item:hover {
    background: var(--fill-secondary);
}

.share-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.share-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.share-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--avatar-text-color);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.share-avatar-inline {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--avatar-text-color);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
    letter-spacing: 0.02em;
}

/* ==================== */
/* Avatar Color Classes */
/* ==================== */
.avatar-color-1 { background: var(--avatar-color-1); }
.avatar-color-2 { background: var(--avatar-color-2); }
.avatar-color-3 { background: var(--avatar-color-3); }
.avatar-color-4 { background: var(--avatar-color-4); }
.avatar-color-5 { background: var(--avatar-color-5); }
.avatar-color-6 { background: var(--avatar-color-6); }
.avatar-color-7 { background: var(--avatar-color-7); }
.avatar-color-8 { background: var(--avatar-color-8); }
.avatar-color-9 { background: var(--avatar-color-9); }
.avatar-color-10 { background: var(--avatar-color-10); }
.avatar-color-11 { background: var(--avatar-color-11); }
.avatar-color-12 { background: var(--avatar-color-12); }
.avatar-color-13 { background: var(--avatar-color-13); }
.avatar-color-14 { background: var(--avatar-color-14); }
.avatar-color-15 { background: var(--avatar-color-15); }

/* ==================== */
/* Theme Selector       */
/* ==================== */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: none;
    background: var(--fill-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--label-primary);
    font-size: 13px;
    font-weight: 500;
}

.theme-option:hover {
    background: var(--fill-secondary);
    transform: scale(1.03);
}

.theme-option.active {
    background: var(--system-blue);
    color: white;
}

.theme-option.active .theme-preview {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.theme-preview {
    width: 80px;
    height: 50px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-small);
    overflow: hidden;
}

/* Theme Preview Colors */
.theme-preview-aurora {
    background: 
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(120, 0, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(0, 100, 255, 0.25) 0%, transparent 50%),
        linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.theme-preview-midnight {
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%);
}

.theme-preview-ocean {
    background: 
        radial-gradient(ellipse 80% 60% at 30% 30%, rgba(0, 150, 180, 0.35) 0%, transparent 50%),
        linear-gradient(180deg, #0c3547 0%, #1a5276 100%);
}

.theme-preview-forest {
    background: 
        radial-gradient(ellipse 70% 50% at 25% 35%, rgba(34, 139, 34, 0.25) 0%, transparent 50%),
        linear-gradient(180deg, #1a2e1a 0%, #0d1f0d 100%);
}

.theme-preview-sunset {
    background: 
        radial-gradient(ellipse 80% 50% at 20% 30%, rgba(255, 100, 50, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(255, 50, 100, 0.25) 0%, transparent 50%),
        linear-gradient(180deg, #2d1f3d 0%, #1f1a2e 100%);
}

.theme-preview-light {
    background: linear-gradient(180deg, #f0f2f5 0%, #e8eaed 100%);
}

.share-details {
    flex: 1;
    min-width: 0;
}

.share-page-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--label-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-from {
    font-size: 12px;
    color: var(--label-secondary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.share-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    background: var(--fill-secondary);
    color: var(--label-primary);
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn-preview {
    background: var(--fill-secondary);
}

.share-btn-preview:hover {
    background: var(--system-blue);
}

.share-btn-accept {
    background: rgba(48, 209, 88, 0.2);
    color: var(--system-green);
}

.share-btn-accept:hover {
    background: var(--system-green);
    color: white;
}

.share-btn-reject {
    background: rgba(255, 69, 58, 0.2);
    color: var(--system-red);
}

.share-btn-reject:hover {
    background: var(--system-red);
    color: white;
}

/* ==================== */
/* Share Preview Grid */
/* ==================== */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
    justify-items: center;
    padding: 8px;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 80px;
}

.preview-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fill-secondary);
    font-size: 20px;
    overflow: hidden;
}

.preview-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.preview-icon span {
    font-size: 18px;
    font-weight: 600;
    color: var(--label-secondary);
}

.folder-preview-icon {
    font-size: 24px;
    background: var(--vibrancy-dark);
}

.preview-label {
    font-size: 11px;
    text-align: center;
    color: var(--label-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ==========================================
   Account Modal Styles
   ========================================== */

.account-modal-content {
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
}

.account-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--separator);
}

.account-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.account-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.account-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--fill-tertiary);
    border-radius: 10px;
}

.account-info-label {
    font-size: 14px;
    color: var(--label-secondary);
}

.account-info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--label-primary);
}

.account-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

.account-pages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-page-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--fill-tertiary);
    border-radius: 10px;
    transition: background 0.15s ease;
}

.account-page-item:hover {
    background: var(--fill-secondary);
}

.account-page-icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
}

.account-page-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-page-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--label-primary);
}

.account-page-stats {
    font-size: 12px;
    color: var(--label-tertiary);
}

.account-page-delete {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.15s ease;
}

.account-page-delete:hover:not(.disabled) {
    background: var(--system-red);
    opacity: 1;
}

.account-page-delete.disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.account-danger-zone {
    background: rgba(255, 69, 58, 0.08);
    border-radius: 12px;
    padding: 20px !important;
    margin: 0 -20px -20px -20px;
    border-bottom: none !important;
}

.account-danger-text {
    font-size: 13px;
    color: var(--label-secondary);
    margin-bottom: 16px;
}

/* Button sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger {
    background: var(--system-red);
    color: white;
}

.btn-danger:hover {
    background: #ff6259;
}

/* Delete Account Warning */
.delete-account-warning {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.delete-account-warning p {
    color: var(--system-red);
    font-size: 14px;
    margin-bottom: 8px;
}

.delete-account-warning p:last-of-type {
    color: var(--label-secondary);
}

.delete-account-warning ul {
    margin: 12px 0 0 20px;
    color: var(--label-secondary);
    font-size: 13px;
}

.delete-account-warning li {
    margin-bottom: 4px;
}

/* Info Button */
.info-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.info-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.1);
}

/* Manual Modal */
.manual-modal-content {
    width: 1000px !important;
    max-width: 95vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
    padding: 0 !important;
    overflow: hidden;
}

.manual-modal-content .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.manual-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
}
