/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Standard-Gradient wird über JavaScript überschrieben */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
}

/* Hintergrundbild-Unterstützung */
body.custom-background {
    /* Hintergrund wird über JavaScript gesetzt */
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
}

/* Overlay für Bild-Hintergründe */
body.custom-background::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, var(--overlay-opacity, 0.3));
    z-index: -1;
    pointer-events: none;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 15px 0;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Alle Header-Icons (Action + Settings) */
.header-icon {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.header-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.header-icon.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Legacy Button-Styles entfernen */
.add-btn {
    display: none;
}

/* Hintergrund-Einstellungen Styles */
.background-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.background-type-options {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.background-type-options .option-btn {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    color: #666;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.background-type-options .option-btn:hover,
.background-type-options .option-btn input:checked + span {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.background-type-options input[type="radio"] {
    display: none;
}

.image-upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.image-upload-area i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.image-upload-area p {
    color: #666;
    margin: 0;
}

.image-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-preview .btn-danger {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Slider Styles */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.logo {
    font-size: 2rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 1.8rem;
}

/* Legacy Button-Styles entfernt - jetzt nur noch Icons */

/* Edit-Modus Styles */
.edit-mode .widget-action-btn,
.edit-mode .action-btn {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.edit-mode .widget-header {
    cursor: grab;
}

.edit-mode .widget-header:active {
    cursor: grabbing;
}

.edit-mode .drag-handle {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Link-Cards im Bearbeitungsmodus - identisch zum Normal-Modus */
.edit-mode .link-card {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 2px 0 !important;
    margin: 0 !important;
}

.edit-mode .link-card:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Drag-Handle für Links */
.link-drag-handle {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: grab;
    color: #999;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    border: 1px solid #ccc;
    margin-left: 4px;
}

.widget.edit-mode .link-drag-handle {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.link-drag-handle:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border-color: #667eea;
    transform: scale(1.1);
}

.link-drag-handle:active {
    cursor: grabbing;
    background: rgba(102, 126, 234, 0.3);
}

/* Text-Selektion während Drag & Drop deaktivieren */
body.dragging {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Drop-Zonen Indikatoren */
.links-grid.drop-zone-active {
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.05);
    transition: all 0.3s ease;
    position: relative;
    min-height: 60px;
}

.links-grid.drop-zone-active::before {
    content: "📥 Hier ablegen";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

/* Drop-Position Indikator */
.sortable-ghost {
    opacity: 0.3 !important;
    background: rgba(102, 126, 234, 0.1) !important;
    border: 2px dashed #667eea !important;
    border-radius: 6px !important;
}

.sortable-drag {
    transform: rotate(5deg) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4) !important;
    z-index: 9999 !important;
}

/* Drop-Zone Hover-Effekt */
.links-grid.drop-zone-active:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    border-color: #5a67d8 !important;
    transform: scale(1.02);
}

/* Dark-Mode Styles */
body.dark-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
    pointer-events: none;
}

body.dark-mode .main-content {
    background: rgba(26, 26, 26, 0.3) !important;
}

body.dark-mode .widget {
    background: #21252b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .widget-title {
    color: white !important;
}

body.dark-mode .widget-description {
    color: #b0b0b0 !important;
}

body.dark-mode .widget-icon {
    color: white !important;
}

body.dark-mode .link-title {
    color: white !important;
}

body.dark-mode .link-url {
    color: #b0b0b0 !important;
}

body.dark-mode .link-description {
    color: #b0b0b0 !important;
}

body.dark-mode .widget-header {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .widget-action-btn {
    color: #b0b0b0 !important;
}

body.dark-mode .widget-action-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

body.dark-mode .action-btn {
    color: #b0b0b0 !important;
}

body.dark-mode .action-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

/* Widget Drop-Zonen Indikatoren */
.widget.widget-drop-zone {
    border: 2px dashed #667eea !important;
    border-radius: 8px !important;
    background: rgba(102, 126, 234, 0.05) !important;
    transition: all 0.3s ease !important;
    position: relative;
}

.widget.widget-drop-zone::before {
    content: "Widget Drop-Zone";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.8;
}

/* Standard-Modus - Buttons versteckt */
.widget-action-btn,
.action-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drag-handle {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Suchbereich */
.search-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.1rem;
}

#searchInput {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}


/* Hauptinhalt */
.main-content {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 10px;
    min-height: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    /* Automatische Höhenanpassung */
    height: auto;
    overflow: visible;
}

.widgets-container {
    position: relative;
    min-height: 200px;
    width: 100%;
    /* Automatische Höhenanpassung für alle Widgets */
    height: auto;
    overflow: visible;
}

/* Drag & Drop Hilfsmittel */
.widgets-container.dragging-active {
    background: rgba(102, 126, 234, 0.02);
}

.widgets-container .sortable-ghost {
    opacity: 0.3;
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed #667eea;
}

.widgets-container .sortable-chosen {
    transform: rotate(2deg) scale(1.02);
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Responsive wird über JavaScript gesteuert */

.widget {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(241, 243, 244, 0.8);
    border-radius: 16px;
    padding: 12px 8px;
    height: fit-content;
    min-height: auto;
    box-sizing: border-box;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    overflow: hidden;
    position: absolute;
    width: calc(25% - 15px);
}

.widget.dragging {
    opacity: 0.8;
    transform: rotate(2deg) scale(1.02);
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Widget-Größen für Column-Layout */
.widget[data-size="small"] { width: 100%; }
.widget[data-size="medium"] { width: 100%; }
.widget[data-size="large"] { width: 100%; }
.widget[data-size="wide"] { width: 100%; }
.widget[data-size="tall"] { width: 100%; }

/* Drop-Zone Styling */
.widgets-container .sortable-ghost {
    opacity: 0.3;
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed #667eea;
}

/* Hervorhebung für verfügbare Drop-Zonen */
.widgets-container.dragging-active .widget:not(.dragging) {
    transition: all 0.2s ease;
}

.widgets-container.dragging-active .widget:not(.dragging):hover {
    transform: scale(1.02);
    z-index: 10;
}

/* Widget hover effects removed */

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f3f4;
    cursor: move;
    user-select: none;
}


.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.drag-handle {
    color: #cbd5e0;
    cursor: move;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #667eea;
}

.widget-icon {
    font-size: 1.3rem;
}

.widget-description {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.widget-actions {
    display: flex;
    gap: 6px;
}

.widget-action-btn {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 0.8rem;
}

.widget-action-btn:hover {
    background: #f1f3f4;
    color: #333;
}

.widget-action-btn.active {
    background: #667eea;
    color: white;
}

/* Kompakt-Modus Styles */
/* Kompakt-Modus Styles entfernt - verwende normale Link-Styles */


.widget-content {
    min-height: auto;
    position: relative;
}

.widget-empty {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-count {
    font-size: 0.8rem;
    color: #666;
    margin-left: 8px;
    font-weight: normal;
}

.empty-widget-message {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
    font-size: 0.9rem;
}

.links-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}


/* Drag & Drop Styles */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    transform: scale(1.02);
}

.widget.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.link-card.dragging {
    opacity: 0.8;
    transform: rotate(5deg);
}

/* Link-Card Basis-Styles */
.link-card {
    background: none;
    border: none;
    border-radius: 0;
    padding: 2px 10px;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
    height: auto;
    min-height: auto;
    width: 100%;
    backdrop-filter: none;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 0;
    gap: 8px;
    z-index: 1;
}

.link-card:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: none;
    box-shadow: none;
}



/* Link-Icon im Kompakt-Modus kleiner */
.widget.compact-mode .link-icon {
    font-size: 0.8rem;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    flex-shrink: 0;
}

/* Link-Icon im normalen Modus */
.link-icon {
    font-size: 1.1rem;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    flex-shrink: 0;
}

/* Link-Content - immer vertikal wie normale Links */
.link-content {
    flex: 1;
    min-width: 0;
    width: 0; /* Wichtig für flex-shrink */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Link-Title - einheitlich für beide Modi */
.link-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    max-width: 100%;
}

/* Link-URL - im Kompakt-Modus verstecken */
.widget.compact-mode .link-url {
    display: none;
}

/* Link-URL im normalen Modus anzeigen */
.link-url {
    color: #666;
    text-decoration: none;
    font-size: 0.75rem;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    max-width: 100%;
}

.link-url:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Beschreibung nur im kompakten Modus ausblenden */
.widget.compact-mode .link-description {
    display: none;
}

/* Beschreibung im normalen Modus anzeigen */
.link-description {
    color: #888;
    font-size: 0.7rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    max-width: 100%;
}

.link-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
}



.link-actions {
    display: flex;
    gap: 6px;
    margin-left: auto; /* Push actions to the right */
    flex-shrink: 0;
    width: auto;
    min-width: 60px; /* Mindestbreite für die Buttons */
}

.action-btn {
    background: none;
    border: none;
    padding: 3px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 0.7rem;
}

.action-btn:hover {
    background: #f1f3f4;
    color: #333;
}


.action-btn.delete:hover {
    background: #fed7d7;
    color: #e53e3e;
}

/* Leerer Zustand */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #4a5568;
}

.empty-state p {
    font-size: 1rem;
    color: #718096;
}

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

.modal.active {
    display: flex;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    padding: 24px 30px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f1f3f4;
    color: #333;
}

.modal-body {
    padding: 24px 30px 30px;
}

/* Formulare */
#linkForm {
    padding: 24px 30px 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3748;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.icon-options {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.icon-option-btn {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    color: #666;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.icon-option-btn:hover,
.icon-option-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

.icon-option-btn i {
    font-size: 0.8rem;
}

.icon-selection {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-selection select {
    flex: 1;
}

.icon-preview {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-size: 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.favicon-preview {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.favicon-preview img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.favicon-status {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #666;
    min-height: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-1px);
}

/* Verbesserte responsive Container-Höhenanpassung */
@media (max-width: 1440px) {
    .main-content {
        min-height: auto;
    }
    
    .widgets-container {
        min-height: auto;
    }
    
    .widget {
        width: calc(33.333% - 15px); /* 3 Spalten */
    }
}

@media (max-width: 1024px) {
    .widget {
        width: calc(50% - 15px); /* 2 Spalten */
    }
    
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .widget {
        width: 100% !important; /* 1 Spalte */
        position: static !important; /* Entferne absolute Positionierung auf mobilen Geräten */
        margin-bottom: 15px !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
    }
    
    .widgets-container {
        height: auto !important; /* Automatische Höhe auf mobilen Geräten */
        position: relative !important;
    }
    
    .main-content {
        height: auto !important;
        min-height: auto !important;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .widget {
        margin-bottom: 10px;
        padding: 10px 6px;
    }
    
    .widget-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .widget-actions {
        align-self: flex-end;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Link-Card Animation */
.link-card {
    animation: fadeIn 0.3s ease;
}

