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

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

:root {
    /* Basis thema variabelen (Light Mode) */
    --primary: #eab308;
    --primary-hover: #ca8a04;
    --secondary: #f59e0b;
    --text-main: #0f172a;
    --text-light: #475569;
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #cbd5e1;
    --blue-btn: #e2e8f0;
    --blue-text: #334155;
    --error-color: #ef4444;
    
    /* Vormgeving & Schaduwen */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -10px rgba(234, 179, 8, 0.15);
    
    /* Achtergrond accenten */
    --bg-grad-1: rgba(234, 179, 8, 0.05);
    --bg-grad-2: rgba(245, 158, 11, 0.05);
    --header-bg: rgba(255, 255, 255, 0.8);
    --modal-overlay: rgba(15, 23, 42, 0.4);
    --input-bg: #f8fafc;
}

/* Automatisch Dark Mode op basis van systeeminstelling */
@media (prefers-color-scheme: dark) {
    :root {
        --text-main: #f8fafc;
        --text-light: #cbd5e1;
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --border-color: #334155;
        --blue-btn: #334155;
        --blue-text: #e2e8f0;
        
        --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
        --shadow-hover: 0 20px 40px -10px rgba(234, 179, 8, 0.3);
        
        --bg-grad-1: rgba(234, 179, 8, 0.15);
        --bg-grad-2: rgba(245, 158, 11, 0.15);
        --header-bg: rgba(30, 41, 59, 0.8);
        --modal-overlay: rgba(0, 0, 0, 0.7);
        --input-bg: #0f172a;
    }
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    background-image: radial-gradient(circle at top right, var(--bg-grad-1), transparent 400px),
                      radial-gradient(circle at bottom left, var(--bg-grad-2), transparent 400px);
    background-attachment: fixed;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typografie hulpmiddelen */
.text-light { color: var(--text-light); }
.text-primary { color: var(--primary); }
.text-error { color: var(--error-color); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.header {
    background: transparent;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-left: auto;
    margin-right: 30px;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Hamburger & Sidebar Styles */
.desktop-nav {
    display: flex;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
}
.hamburger-btn {
    display: none;
    font-size: 1.8rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    margin-left: auto;
}
.close-menu-btn {
    display: none;
}
#mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.login-btn {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.login-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Homepage Hero */
.hero-section {
    padding: 6rem 5% 4rem 5%;
    position: relative;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    color: var(--text-main);
}

.hero-subtitle {
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.action-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.action-card .btn-primary {
    background: linear-gradient(135deg, var(--primary), #fde047);
    color: white;
    border: none;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
}

.action-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(234, 179, 8, 0.4);
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    background: var(--input-bg);
    color: var(--text-main);
    transition: all 0.3s;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.1);
}

/* Info Cards */
.how-it-works-section {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 5%;
}

.how-it-works-title {
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.info-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}
.info-card:hover {
    transform: translateY(-5px);
}

.info-card h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.info-card p {
    color: var(--text-light);
}

/* Lijstweergave Layout */
.list-layout {
    max-width: 1200px;
    margin: 3rem auto;
    display: flex;
    gap: 4rem;
    padding: 0 5%;
}

/* Zijbalk */
.sidebar {
    width: 240px;
    flex-shrink: 0;
}
.sidebar h3 {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}
.sidebar ul { list-style: none; }
.sidebar li {
    margin-bottom: 0.5rem;
}
.sidebar a {
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.sidebar a:hover {
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

/* Hoofdcontent Lijstje */
.main-content {
    flex: 1;
}

/* Profiel sectie */
.profile-section {
    display: flex;
    gap: 2.5rem;
    margin-bottom: 3rem;
    align-items: center;
}

.profile-pic {
    width: 140px;
    height: 140px;
    background-color: var(--card-bg);
    border-radius: 50%;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-soft);
    border: 4px solid var(--card-bg);
}

.profile-info h2 {
    color: var(--text-main);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* Lijst Items */
.category-title {
    color: var(--text-main);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.items-container {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.item-row {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.item-row:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.item-done {
    opacity: 0.6;
    background: var(--bg-color);
}
.item-done h4 {
    text-decoration: line-through;
}

.item-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.item-img-large {
    width: 120px;
    height: 120px;
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    overflow: hidden;
    flex-shrink: 0;
    margin-left: 20px;
    border: 1px solid var(--border-color);
}

.item-img-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details h4 {
    margin-bottom: 0.4rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.item-details p {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

.item-details a {
    color: var(--primary);
    text-decoration: none;
    background: rgba(234, 179, 8, 0.1);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 10px;
}
.item-details a:hover {
    background: rgba(234, 179, 8, 0.2);
}

/* Afstrepen knop */
.btn-afstrepen {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.2);
}

.btn-afstrepen:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

.btn-afstrepen.afgestreept {
    background-color: var(--blue-btn);
    color: var(--blue-text);
    box-shadow: none;
}
.btn-afstrepen.afgestreept:hover {
    background-color: var(--border-color);
}

/* Voeg toe knop */
.btn-add-modal {
    background: var(--card-bg);
    color: var(--text-main);
    border: 2px dashed var(--border-color);
    padding: 20px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    cursor: pointer;
    font-size: 1.1rem;
    width: 100%;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn-add-modal:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(234, 179, 8, 0.05);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

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

.modal-content {
    background: var(--card-bg);
    color: var(--text-main);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: translateY(20px);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border: 1px solid var(--border-color);
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.modal-content h3 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Tabs in modal */
.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    background: var(--bg-color);
    padding: 6px;
    border-radius: 12px;
}

.modal-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
}
.modal-tab.active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}
.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-main);
    transition: all 0.2s;
    font-size: 1rem;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
}
.form-group input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 2.5rem;
}

.btn-cancel {
    background: var(--bg-color);
    color: var(--text-main);
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-cancel:hover { background: var(--border-color); }

.btn-confirm {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}
.btn-confirm:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Zoek resultaten Grid */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.search-item {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
}
.search-item:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.search-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}
.search-item h5 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main);
}
.search-item p {
    color: var(--primary);
    font-weight: 800;
}

/* File Upload Label */
.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: var(--text-light);
    font-weight: 500;
}
.file-upload-label:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--surface-color);
}
.file-upload-label input[type="file"] {
    display: none;
}
.file-name-display {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
}

@media (max-width: 600px) {
    .item-row {
        flex-direction: column;
        align-items: center !important;
        text-align: center;
    }
    .item-img-large {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        max-width: 250px;
        height: auto;
        aspect-ratio: 1/1;
    }
    .item-details > div {
        justify-content: center;
    }
    .drag-handle {
        position: absolute;
        top: 10px;
        right: 15px;
        margin-left: 0 !important;
    }
    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    .profile-info p {
        justify-content: center;
    }
    .modal-content {
        padding: 1.5rem;
        width: calc(100% - 30px);
        max-width: 100vw;
        margin: 0 15px;
        word-break: break-word;
    }
    .modal-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    .modal-actions button {
        width: 100%;
        margin-top: 10px;
    }
    .hero-section {
        padding: 3rem 5% 2rem 5%;
    }
    .action-card, .info-card {
        padding: 1.5rem;
    }
    .header {
        padding: 0 15px;
    }
    .header-logo {
        font-size: 1.2rem;
    }
    
    /* Mobile Menu overrides */
    .hamburger-btn {
        display: block;
    }
    .desktop-nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 250px;
        height: 100vh;
        background: var(--card-bg);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 80px 20px 20px 20px;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    .desktop-nav.open {
        right: 0;
    }
    #mobile-overlay.open {
        display: block;
    }
    .close-menu-btn {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: transparent;
        border: none;
        font-size: 2rem;
        color: var(--text-light);
        cursor: pointer;
    }
    .header-nav {
        flex-direction: column !important;
        align-items: flex-start !important;
        margin: 0 !important;
        width: 100%;
        gap: 20px !important;
        margin-bottom: 30px !important;
    }
    .header-right {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100%;
    }
    #logged-in-user {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 500px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 4px;
}

.bottom-nav-item.active, .bottom-nav-item:hover {
    color: var(--primary);
}

.bottom-nav-item .icon {
    font-size: 1.4rem;
}

body {
    padding-bottom: 70px;
}

/* SVG Icons for Bottom Nav using CSS Masks to inherit colors */
.icon-svg {
    width: 24px;
    height: 24px;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}
.icon-home { -webkit-mask-image: url('../images/icons/home-6-svgrepo-com.svg'); mask-image: url('../images/icons/home-6-svgrepo-com.svg'); }
.icon-lists { -webkit-mask-image: url('../images/icons/list-svgrepo-com.svg'); mask-image: url('../images/icons/list-svgrepo-com.svg'); transform: scale(0.85); }
.icon-bell { -webkit-mask-image: url('../images/icons/bell-alt-svgrepo-com.svg'); mask-image: url('../images/icons/bell-alt-svgrepo-com.svg'); }
.icon-account { -webkit-mask-image: url('../images/icons/account-avatar-person-svgrepo-com.svg'); mask-image: url('../images/icons/account-avatar-person-svgrepo-com.svg'); transform: scale(0.85); }
.icon-shop { -webkit-mask-image: url('../images/icons/shopping-cart-round-1137-svgrepo-com.svg'); mask-image: url('../images/icons/shopping-cart-round-1137-svgrepo-com.svg'); transform: scale(0.85); }

/* Animated Checkmark for Copy Link */
.animated-check {
    width: 20px;
    height: 20px;
    stroke-width: 3;
    stroke: #22c55e;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawCheck 0.4s ease-out forwards;
    vertical-align: middle;
}
@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* Cropper Circular Mask */
.cropper-view-box,
.cropper-face {
  border-radius: 50%;
}
/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1);
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}
