/* Card Styles */
.kanban-card {
    border-radius: 4px;
    border: 1px solid #777777;
    padding: 0rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: grab;
    transition: all 0.3s ease;
    max-height: 800px;
    min-height: 13rem;
    overflow: hidden;
    position: relative;
    height: fit-content;
    flex: 0 1 auto; 
    padding-top: 2.2rem; 
    display: flex;
    flex-direction: column;
}

.kanban-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.kanban-card.inactive {
    opacity: 0.5;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0.5rem 1rem; /* Innenabstand im Header */
    border-radius: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    width: calc(100% + 2rem); /* Überdeckt den Padding-Bereich der Karte */
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    background: linear-gradient(195deg, rgba(253, 152, 62, 0.53) 0%,rgba(253, 252, 222, 0.53) 50%, rgba(186, 74, 226, 0.79) 100%);
}

.card-title {
    font-weight: bold;
    font-size: 0.95rem;
    padding: 0;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #7f8c8d;
    transition: color 0.2s;
}

.card-btn:hover {
    color: #4a90e2;
}

.card-btn.eye-min {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-right: 0.2rem;
}

.card-content {
    font-size: 0.9rem;
    color: #5a6c7d;
    margin-bottom: 0.5rem;
    transition: max-height 0.3s cubic-bezier(.4,0,.2,1), opacity 0.2s;
    max-height: auto;
    overflow: hidden;
}

.card-comments {
    font-size: 0.85rem;
    color: #95a5a6;
}

/* Kommentare und URLs in Karten */
.card-comment {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border-left: 3px solid #95a5a6;
}

.card-url {
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 4px;
    border-left: 3px solid #4a90e2;
}

.card-url-link {
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.8rem;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-url-link:hover {
    text-decoration: underline;
    color: #357abd;
}

/* Verhindert dass Drag&Drop durch URL-Klick unterbrochen wird */
.card-url-link:active {
    pointer-events: auto;
}

.kanban-card.dragging .card-url-link {
    pointer-events: none;
}

/* --- Karten Slide/Expand/Minimize --- */
.kanban-card.expanded {
    max-height: 1000px; /* groß genug für Inhalt */
    overflow: visible;
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.kanban-card.minimized {
    max-height: 48px;
    min-height: 32px;
    overflow: hidden;
    padding-bottom: 0;
}

.kanban-card .slide-toggle {
    margin-left: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    transition: transform 0.2s;
}

.kanban-card .slide-toggle.rotated {
    transform: rotate(180deg);
}

.kanban-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0.5rem 1rem; /* Innenabstand im Header */
    border-radius: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    width: calc(100% + 0rem); /* Überdeckt den Padding-Bereich der Karte */
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}

.kanban-card .card-title {
    flex: 1;
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
}


/* Card Vorschau und Thumbnail als Coverbild */
.card-thumb {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    margin-bottom: 0.5rem;
    display: block;
}
.card-thumb img {
    max-width: 100%;
    object-fit: cover;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    display: block;
}
.card-preview-content {
    font-size: 0.95rem;
    color: #000;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
    min-height: 1.5em;
    padding: 0 0.5rem;
    max-height: fit-content;
    flex: 1 1 auto; /* Flexbox für dynamische Höhe */
}
.card-preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.kanban-card .card-title {
    padding: 0.rem 0.5rem 0.1rem 0.5rem;
}
.kanban-card .card-header {
    padding: 0.2rem 0.5rem 0.2rem 0.5rem;
}

/* Full Card Modal */
#full-card-modal {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
#full-card-modal .modal-content {
    border-radius: 12px;
    padding: 0;
    min-width: 650px;   
    max-width: 1024px;
    width: fit-content;
    max-height: 95vh;
    height: fit-content;
    box-shadow: 0 12px 48px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
}
#full-card-modal .modal-header {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, rgba(45,55,72,0.95) 0%, rgba(26,32,44,0.95) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#full-card-modal .modal-header h2 {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    padding-right: 1rem;
    max-height: 5.6rem; /* Platz für 4 Zeilen bei 1.4 line-height */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    /* Dynamische Größenanpassung für sehr lange Titel */
    font-size: clamp(1rem, 1.2rem, 1.2rem);
    line-height: clamp(1.2, 1.4, 1.4);
}

/* Button-Container für bessere Gruppierung */
#full-card-modal .modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* Primäre Action-Buttons */
#full-card-modal .modal-header-actions .primary-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sekundäre Action-Buttons */
#full-card-modal .modal-header-actions .secondary-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.75rem;
    margin-left: 0.25rem;
    border-left: 1px solid rgba(255,255,255,0.2);
}

#full-card-modal .card-btn {
    color: #e2e8f0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    min-width: -webkit-fill-available; /* Samsung Internet fallback */
    min-width: fit-content;
}

#full-card-modal .card-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

#full-card-modal .card-btn.delete-btn {
    color: #fed7d7;
    background: rgba(220,53,69,0.2);
    border-color: rgba(220,53,69,0.3);
}

#full-card-modal .card-btn.delete-btn:hover {
    color: #fff;
    background: rgba(220,53,69,0.4);
    border-color: rgba(220,53,69,0.5);
}

#full-card-modal .close-btn {
    position: inherit; /* Override modal.css absolute positioning */
    color: #cbd5e0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
}

#full-card-modal .close-btn:hover {
    color: #fff;
    background: rgba(239,68,68,0.3);
    border-color: rgba(239,68,68,0.4);
    transform: translateY(-1px);
}
/* Modal Body Styles */
#full-card-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fff;
}

.card-thumb-modal {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.card-thumb-modal img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.card-content-full {
    color: #2d3748;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 400px;
    overflow: auto;
    /* Verbesserte Zeilenumbruch-Behandlung - OHNE pre-wrap */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal; /* WICHTIG: normal statt pre-wrap */
    overflow-x: hidden;
    max-width: 100%;
}
.card-content-full p{
    overflow-wrap: break-word;
    word-break: break-word;
    word-wrap: break-word;
    white-space: normal; /* WICHTIG: normal statt pre-wrap */
}
.card-content-full div {
    overflow-wrap: break-word;
    word-break: break-word;
    word-wrap: break-word;
    white-space: normal; /* WICHTIG: normal statt pre-wrap */
}
.card-content-full ul, .card-content-full ol{
    white-space: normal;
    margin: 0.5rem 0;
    word-wrap: break-word;
    word-break: break-word;
}
.card-content-full li {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Comments and URLs in Full Modal */
#full-card-modal .card-comment {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border-radius: 8px;
    border-left: 4px solid #4299e1;
    color: #2d3748;
    font-size: 0.95rem;
}

#full-card-modal .card-comment::before {
    content: "💬";
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

#full-card-modal .card-url {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

#full-card-modal .card-url-link {
    color: #3182ce;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    word-break: break-all;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#full-card-modal .card-url-link::before {
    content: "🔗";
    font-size: 1.1rem;
}

#full-card-modal .card-url-link:hover {
    text-decoration: underline;
    color: #2c5282;
}

/* Responsive Design für Full Card Modal */
@media (max-width: 768px) {
    #full-card-modal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 0.5rem;
    }
    
    #full-card-modal .modal-header {
        padding: 0.75rem 1rem;
    }
      #full-card-modal .modal-header h2 {
        font-size: 1.1rem;
        padding-right: 1rem;
        max-height: 3.5rem; /* Angepasst für mobile Geräte */
    }
    
    #full-card-modal .modal-header-actions {
        gap: 0.5rem;
    }
    
    #full-card-modal .modal-header-actions .primary-actions {
        margin-right: 0.5rem;
        padding-right: 0.5rem;
    }
    
    #full-card-modal .modal-header-actions .secondary-actions {
        padding-left: 0.5rem;
    }
    
    #full-card-modal .card-btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }
    
    #full-card-modal .modal-body {
        padding: 1rem;
    }
    
    .card-content-full {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    #full-card-modal .modal-header {
        padding: 0.6rem 0.8rem;
    }
    
    #full-card-modal .modal-header h2 {
        font-size: 1rem;
        padding-right: 0.8rem;
        max-height: 3rem;
    }
    
    #full-card-modal .modal-header-actions {
        gap: 0.4rem;
    }
    
    #full-card-modal .modal-header-actions .primary-actions {
        border-right: none;
        margin-right: 0.25rem;
        padding-right: 0;
        gap: 0.3rem;
    }
    
    #full-card-modal .modal-header-actions .secondary-actions {
        padding-left: 0.4rem;
        gap: 0.3rem;
    }
    
    #full-card-modal .card-btn {
        padding: 0.25rem 0.3rem;
        font-size: 0.75rem;
    }
    
    #full-card-modal .close-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
}
/* Modal Layering */
#full-card-modal {
    z-index: 3000;
}
#card-modal {
    z-index: 4000;
}

/* Vorschau beim Drag&Drop: Card mit .card-preview-placeholder hervorheben */
.kanban-card.card-preview-placeholder {
    opacity: 0.6;
    border: 2px dashed #4a90e2;
    box-shadow: 0 0 0 2px #4a90e233;
    transition: opacity 0.15s, border 0.15s;
    rotate: 2deg;
}

/* Drag&Drop Ghost/Chosen Styles für SortableJS */
.kanban-card-drag-ghost {
    opacity: 0.6;
    background: #e0e7ff;
    border: 2px dashed #4a90e2;
    box-shadow: 0 0 8px #4a90e2aa;
    rotate: 2deg;
}
.kanban-card-drag-chosen {
    box-shadow: 0 4px 16px #4a90e2aa;
    opacity: 0.9;
    rotate: 2deg;
}
.kanban-card-drag-chosen:active{
    rotate: 1deg;

}
.kanban-card-dragging {
    opacity: 0.5;
    
}

/* Selected card styling for keyboard deletion */
.kanban-card.selected {
    box-shadow: 0 0 0 2px #4a90e2;
    border-color: #4a90e2;
}

.kanban-card.selected .card-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2) 0%, rgba(74, 144, 226, 0.1) 100%);
}

.kanban-card .card-btn.card-delete{
    display: none;
}
.kanban-card.selected .card-btn.card-delete{
    display: inline-block;
}

/* Delete button styling */
.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Card Labels Styling */
.card-footer {
    padding: 0 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.9);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    min-height: 2rem ;
}

.card-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    flex-wrap: wrap;
}

.card-comments-count {
    color: #95a5a6;
    font-size: 0.8rem;
}

.card-url-link {
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.card-url-link:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: auto;
}

.card-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Labels in Full Modal */
.card-labels-full {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-label-full {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-label-full:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

/* Individuelle Label-Farben basierend auf Hash-Werten */
.card-label.label-color-1,
.card-label-full.label-color-1 {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%); /* Rot */
}

.card-label.label-color-2,
.card-label-full.label-color-2 {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%); /* Türkis */
}

.card-label.label-color-3,
.card-label-full.label-color-3 {
    background: linear-gradient(135deg, #45b7d1 0%, #3a97b3 100%); /* Blau */
}

.card-label.label-color-4,
.card-label-full.label-color-4 {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%); /* Orange */
}

.card-label.label-color-5,
.card-label-full.label-color-5 {
    background: linear-gradient(135deg, #6c5ce7 0%, #5f3dc4 100%); /* Lila */
}

.card-label.label-color-6,
.card-label-full.label-color-6 {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%); /* Helles Lila */
}

.card-label.label-color-7,
.card-label-full.label-color-7 {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%); /* Pink */
}

.card-label.label-color-8,
.card-label-full.label-color-8 {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%); /* Grün */
}

.card-label.label-color-9,
.card-label-full.label-color-9 {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%); /* Warmes Orange */
}

.card-label.label-color-10,
.card-label-full.label-color-10 {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); /* Himmelblau */
}

/* Card AI Button - nur bei selected sichtbar */
.card-ai-btn {
    display: none;
}

.kanban-card.selected .card-ai-btn {
    display: inline-block;
}

.card-ai-btn:hover {
    background-color: rgba(51, 154, 240, 0.2) !important;
}

/* Call2Actions Buttons */
.call2actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.call2action-btn {
    padding: 0.2rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 120px;
}

.call2action-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.call2action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.call2action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .call2actions-buttons {
        gap: 0.2rem;
    }
    
    .call2action-btn {
        padding: 0.1rem 0.4rem;
        font-size: 0.7rem;
        max-width: 100px;
    }
}
