:root {
    --theme-color: #4CAF50;
    --theme-color-light: #81c784;
    --theme-color-dark: #388e3c;
    --theme-color-rgb: 76, 175, 80;
    --column-gap: 20px;
}

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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.menu-toggle {
    background: var(--theme-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
}

.menu-toggle:hover {
    background: var(--theme-color-dark);
    transform: scale(1.05);
}

.header-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 20px;
    min-width: 300px;
    max-width: 90%;
    z-index: 1000;
    display: none;
    animation: modalFadeIn 0.3s ease;
    border: 2px solid var(--theme-color);
}

.header-modal.visible {
    display: block;
}

.header-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
    animation: overlayFadeIn 0.3s ease;
}

.header-modal-overlay.visible {
    display: block;
}

.header-modal-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-modal-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-modal-section h3 {
    margin: 0;
    color: var(--theme-color);
    font-size: 1.1em;
}

.header-modal-section p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.header-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-modal-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: none;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 1em;
}

.header-modal-button:hover {
    background: rgba(var(--theme-color-rgb), 0.1);
    border-color: var(--theme-color);
}

.header-modal-button i {
    font-size: 1.2em;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

/* Nieuwe widget container layout */
.widget-container {
    display: flex;
    gap: var(--column-gap);
    min-height: 100vh;
}

.widget-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--column-gap);
}

/* Verberg kolommen op basis van configuratie */
.widget-container[data-columns="1"] .widget-column:not(:first-child) {
    display: none;
}

.widget-container[data-columns="2"] .widget-column:nth-child(n+3) {
    display: none;
}

.widget-container[data-columns="3"] .widget-column:nth-child(n+4) {
    display: none;
}

.category-widget {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    break-inside: avoid;
    margin-bottom: 0;
    position: relative;
}

.category-header {
    background-color: var(--theme-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.category-header h2 {
    margin: 0;
    font-size: 1.2em;
}

.category-actions {
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: relative;
}

.category-widget:hover .category-actions {
    opacity: 1;
}

.menu-icon {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: opacity 0.2s ease;
    opacity: 0.7;
}

.menu-icon:hover {
    opacity: 1;
}

.menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 10px;
    display: none;
    min-width: 120px;
    z-index: 10;
}

.menu-dropdown.visible {
    display: block;
    animation: fadeIn 0.2s ease;
}

.menu-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--theme-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.menu-dropdown button:hover {
    background-color: rgba(var(--theme-color-rgb), 0.1);
}

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

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.category-content.expanded {
    max-height: 2000px; /* Genoeg ruimte voor de content */
    opacity: 1;
}

.add-link-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.category-widget:hover .add-link-btn {
    opacity: 0.7;
}

.add-link-btn:hover {
    opacity: 1;
}

/* Hide add link button when collapsed */
.category-content[style*="display: none"] + .add-link-btn {
    display: none;
}

.category-description {
    padding: 10px 15px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
    color: #666;
}

.category-links {
    padding: 15px;
    position: relative;
    min-height: 50px;
}

.category-links.grid {
    display: grid;
    gap: 10px;
}

/* Links per row configuration */
.category-links.grid[data-links-per-row="1"] {
    grid-template-columns: 1fr;
}

.category-links.grid[data-links-per-row="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.category-links.grid[data-links-per-row="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.category-links.grid[data-links-per-row="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.category-links.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-container {
    position: relative;
    transition: all 0.2s ease;
}

.link-container.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.drag-handle {
    position: absolute;
    right: 10px;
    top: 25px;
    transform: translateY(-50%);
    opacity: 0;
    cursor: grab;
    padding: 5px;
    color: var(--theme-color);
    transition: opacity 0.2s ease;
    z-index: 2;
}

.link-container:hover .drag-handle {
    opacity: 0.7;
}

.drag-handle:hover {
    opacity: 1 !important;
}

.link-item {
    display: block;
    padding: 10px;
    padding-right: 35px; /* Ruimte voor drag handle */
    color: var(--theme-color);
    text-decoration: none;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: white;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.link-item:hover {
    background-color: var(--theme-color);
    color: white;
}

.link-item:hover + .drag-handle,
.link-container.dragging .drag-handle {
    color: white;
}

/* Touch device optimizations */
@media (hover: none) {
    .drag-handle {
        display: none;
    }

    .link-item {
        padding-right: 10px;
    }
}

/* Modal styling */
.modal,
.header-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 20px;
    min-width: 300px;
    max-width: 90%;
    z-index: 1000;
    display: none;
    animation: modalFadeIn 0.3s ease;
    border: 2px solid var(--theme-color);
}

.modal.visible,
.header-modal.visible {
    display: block;
}

.modal-content {
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--theme-color);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
    animation: overlayFadeIn 0.3s ease;
}

.modal-overlay.visible {
    display: block;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
}

.form-group select,
.form-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: var(--theme-color);
    color: white;
}

button:hover {
    background-color: var(--theme-color-dark);
}

button.danger {
    background-color: #dc3545;
}

button.danger:hover {
    background-color: #c82333;
}

input[type="file"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
}

input[type="file"]::-webkit-file-upload-button {
    padding: 8px 16px;
    background-color: var(--theme-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background-color: var(--theme-color-dark);
}

/* Mobile notice styling */
.mobile-notice {
    display: none;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.mobile-notice p {
    margin: 0;
    line-height: 1.4;
}

/* Responsive design */
@media (max-width: 1200px) {
    .widget-container {
        flex-direction: column;
    }

    .widget-column {
        width: 100%;
    }

    .widget-container[data-columns] .widget-column {
        display: block;
    }

    .category-links.grid[data-links-per-row] {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    header h1 {
        font-size: 1.5em;
    }

    .desktop-only-settings {
        display: none;
    }

    .mobile-notice {
        display: block;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
    }

    .category-widget {
        margin-bottom: 15px;
    }

    .category-header h2 {
        font-size: 1.1em;
    }

    .category-links.grid {
        grid-template-columns: 1fr !important;
    }

    .link-container:hover::before {
        display: none;
    }

    .link-item {
        padding: 12px;
        font-size: 1em;
    }
}

/* Drag and Drop styling */
.link-container:hover::before {
    content: '⋮';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-color);
    font-size: 20px;
    opacity: 0.5;
}

.category-links::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border: 2px dashed transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.category-links:not(:empty)::after {
    border-color: transparent;
}

.category-widget .category-links:empty::after {
    content: 'Sleep links hierheen';
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: var(--theme-color);
    color: var(--theme-color);
    opacity: 0.5;
}

.category-links.dragover::after {
    border-color: var(--theme-color);
    background-color: rgba(var(--theme-color-rgb), 0.05);
}

textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
}

/* Trash Bin styling */
.trash-bin {
    position: fixed;
    right: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--theme-color);
    border-radius: 8px;
    margin: 0;
    max-height: 90vh;
    overflow: hidden;
}

.trash-bin.visible {
    right: 0;
    pointer-events: auto;
    margin: 20px;
}

.trash-bin.drag-over-trash {
    background: #ffebee;
}

.trash-header {
    padding: 15px;
    background: var(--theme-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
    border-radius: 6px 6px 0 0;
}

.trash-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.trash-content {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    pointer-events: auto;
}

.trash-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trash-item {
    background: #f8f8f8;
    padding: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.trash-item:hover {
    background: #f0f0f0;
}

.trash-item-actions {
    display: flex;
    gap: 5px;
}

.trash-item-actions button {
    padding: 5px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.trash-item-actions button:hover {
    opacity: 1;
}

/* Drag and Drop styles */
.dragging .trash-bin {
    right: 0;
}

.drag-over-trash {
    background: #ffebee !important;
}

.trash-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.trash-actions .modal-close {
    color: white;
    font-size: 24px;
    padding: 0;
    margin: 0;
}

.trash-actions .modal-close:hover {
    color: rgba(255,255,255,0.8);
} 