/* ===================================
   DRAG & DROP IMPORT STYLES v2.1
   Komplette überarbeitete Version mit korrekten Border-Radien
   =================================== */

/* ===== DRAG OVER STATES ===== */
.import-section.drag-over {
    background: rgba(244, 192, 102, 0.15) !important;
    border: 2px dashed #F4C066 !important;
    border-radius: 12px !important;
    transform: scale(1.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(244, 192, 102, 0.3);
}

/* KORRIGIERT: Respektiert expanded Zustand bei Drag Over */
.import-section.drag-over .import-header {
    background: rgba(244, 192, 102, 0.3) !important;
    border-color: #F4C066 !important;
    border-radius: 10px !important;
}

.import-section.drag-over .import-header.expanded {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none !important;
}

#import-text.drag-over {
    background: rgba(244, 192, 102, 0.1) !important;
    border: 2px dashed #F4C066 !important;
    border-radius: 8px !important;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(244, 192, 102, 0.4);
}

/* ===== DRAG & DROP HINTS ===== */
.import-section .drag-drop-hint {
    color: #D8C5B0 !important;
    font-size: 0.75rem !important;
    font-style: normal !important;
    opacity: 0.7 !important;
    transition: opacity 0.3s ease !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
    display: block !important;
    text-align: left !important;
    margin-left: 0 !important;
    padding: 0 !important;
}

.import-section:hover .drag-drop-hint {
    opacity: 1 !important;
}

.import-section .drag-drop-hint i {
    font-size: 0.8rem !important;
    color: #F4C066 !important;
    margin-right: 0.3rem !important;
}

/* ===== IMPORT TITLE STRUCTURE ===== */
.import-section .import-title {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.import-section .import-title-text {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.import-section .import-title-text > span:first-child,
.import-section .import-title-text > :first-child:not(.drag-drop-hint) {
    font-weight: bold !important;
    font-size: 1.1rem !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.import-section .import-title > i {
    margin-top: 0.1rem !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
}

/* ===== IMPORT HEADER LAYOUT ===== */
.import-section .import-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    transition: all 0.3s ease;
}

/* KORRIGIERT: Keine Überschreibung der Border-Radien */
.import-section .import-header.expanded {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none !important;
}

.import-section .import-toggle {
    flex-shrink: 0 !important;
    margin-top: 0.2rem !important;
}

/* ===== ENHANCED IMPORT HEADER ===== */
.import-header-enhanced {
    position: relative;
    overflow: hidden;
}

/* KORRIGIERT: Respektiert expanded Border-Radien */
.import-header-enhanced::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 192, 102, 0.2), transparent);
    transition: left 0.5s ease;
}

.import-section.drag-over .import-header-enhanced::after {
    left: 100%;
}

/* ===== DRAG ZONE INDICATOR ===== */
.drag-zone-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(244, 192, 102, 0.9);
    color: #2C2623;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: bold;
    display: none;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    animation: pulse 1s ease-in-out infinite;
}

.drag-over .drag-zone-indicator {
    display: block;
}

@keyframes pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.05); 
    }
}

/* ===== CONFIRMATION DIALOG ===== */
.drag-drop-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 26, 23, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.drag-drop-confirmation {
    background: linear-gradient(135deg, #2C2623 0%, #1E1A17 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
}

.drag-drop-confirmation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #F4C066, #CB8358, #F4C066);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.drag-drop-confirmation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.drag-drop-confirmation-header h3 {
    color: #F4C066;
    margin: 0;
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.drag-drop-close {
    background: #C8491D;
    color: #F5F5F5;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.drag-drop-close:hover {
    background: #FF8232;
    transform: scale(1.1);
}

.drag-drop-confirmation-body {
    margin-bottom: 2rem;
}

.drag-drop-confirmation-body p {
    color: #F5F5F5;
    margin: 0;
    line-height: 1.6;
    font-size: 1.1rem;
}

.drag-drop-confirmation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.drag-drop-btn-confirm {
    background: linear-gradient(135deg, #F4C066 0%, #D99C45 100%);
    color: #2C2623;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 120px;
}

.drag-drop-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(244, 192, 102, 0.4);
    border-color: #CB8358;
}

.drag-drop-btn-cancel {
    background: linear-gradient(135deg, #CB8358 0%, #A85F3D 100%);
    color: #F5F5F5;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 120px;
}

.drag-drop-btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(203, 131, 88, 0.4);
    border-color: #F4C066;
}

/* ===== ENHANCED IMPORT TEXTAREA ===== */
#import-text {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 8px;
}

#import-text.drag-ready {
    background: rgba(244, 192, 102, 0.05);
    border-color: rgba(244, 192, 102, 0.3);
}

/* ===== FILE DROP FEEDBACK ===== */
.file-drop-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(244, 192, 102, 0.95);
    color: #2C2623;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s ease;
    pointer-events: none;
}

.file-drop-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.file-drop-feedback i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ===== AUTO-IMPORT PROGRESS ===== */
.auto-import-progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.auto-import-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #F4C066, #CB8358);
    width: 0;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.drag-drop-toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #2C2623 0%, #1E1A17 100%);
    color: #F5F5F5;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 3000;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

.drag-drop-toast.success {
    border-left: 4px solid #35A2A2;
}

.drag-drop-toast.error {
    border-left: 4px solid #FF8232;
}

.drag-drop-toast.info {
    border-left: 4px solid #F4C066;
}

/* ===== ANIMATIONS ===== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== HOVER ENHANCEMENTS ===== */
.import-section:hover {
    transition: all 0.2s ease;
}

/* KORRIGIERT: Hover respektiert expanded Zustand und wirkt auf gesamte Sektion */
.import-section:hover .import-header {
    border-radius: 10px;
}

.import-section:hover .import-header.expanded {
    border-radius: 10px 10px 0 0 !important;
    background: rgba(203, 131, 88, 0.2) !important;
    border-color: #F4C066 !important;
}

.import-section:hover .import-content.expanded {
    background: rgba(203, 131, 88, 0.08) !important;
    border-color: #F4C066 !important;
}

/* ===== OVERRIDE FIXES ===== */
.import-section .import-title * {
    box-sizing: border-box !important;
}

.import-section .import-title-text > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.import-section .import-title-text > .drag-drop-hint {
    margin-top: 0 !important;
}

/* ===== IMPORT SECTION BASE STYLES ===== */
.import-section {
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: visible; /* GEÄNDERT: Erlaubt Border-Radius Änderungen */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .drag-drop-confirmation {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .drag-drop-confirmation-buttons {
        flex-direction: column;
    }
    
    .drag-drop-btn-confirm,
    .drag-drop-btn-cancel {
        width: 100%;
    }
    
    .drag-drop-toast {
        right: 1rem;
        top: 1rem;
        max-width: calc(100vw - 2rem);
        border-radius: 8px;
    }
    
    .drag-zone-indicator {
        border-radius: 10px;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .file-drop-feedback {
        border-radius: 10px;
        padding: 1rem 1.5rem;
        max-width: calc(100vw - 2rem);
    }
}

@media (max-width: 480px) {
    .import-section {
        border-radius: 8px;
    }
    
    .import-section.drag-over {
        border-radius: 8px !important;
    }
    
    .import-section .import-header {
        border-radius: 6px;
    }
    
    .import-section .import-header.expanded {
        border-radius: 6px 6px 0 0 !important;
    }
    
    #import-text {
        border-radius: 6px;
    }
    
    #import-text.drag-over {
        border-radius: 6px !important;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    .import-section.drag-over,
    #import-text.drag-over,
    .drag-zone-indicator,
    .file-drop-feedback {
        transform: none !important;
        animation: none !important;
    }
    
    .import-section,
    .import-header,
    #import-text {
        transition: none !important;
    }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    .import-section.drag-over {
        border: 3px dashed #F4C066 !important;
        background: rgba(244, 192, 102, 0.25) !important;
    }
    
    .drag-drop-confirmation {
        border: 2px solid #F4C066;
    }
    
    .drag-drop-toast {
        border: 1px solid #F4C066;
    }
}