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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d5b7 50%, #d4a574 100%);
    background-attachment: fixed;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(212, 165, 116, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(184, 134, 11, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 249, 230, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(139, 90, 43, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(212, 165, 116, 0.3);
    position: relative;
    z-index: 1;
}

/* Box Styling - Glasmorphismus */
.box {
    border: 1px solid rgba(212, 165, 116, 0.3);
    background: rgba(255, 249, 230, 0.5);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 
        0 4px 16px rgba(139, 90, 43, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.box:hover {
    background: rgba(255, 249, 230, 0.6);
    box-shadow: 
        0 6px 24px rgba(139, 90, 43, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Top Row */
.top-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.mediaplan-box {
    flex: 0 0 200px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(244, 228, 188, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #6b4423;
    box-shadow: 
        0 4px 12px rgba(139, 90, 43, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    gap: 8px;
}

.logout-link {
    font-size: 12px;
    color: #8b5a2b;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: normal;
}

.logout-link:hover {
    color: #6b4423;
    text-decoration: underline;
}

.class-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.class-box label {
    font-weight: bold;
    white-space: nowrap;
    color: #6b4423;
}

.class-box select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(212, 165, 116, 0.4);
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #6b4423;
    transition: all 0.3s ease;
}

.class-box select:focus {
    outline: none;
    border-color: rgba(184, 134, 11, 0.6);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 0 0 3px rgba(184, 134, 11, 0.2),
        0 4px 12px rgba(139, 90, 43, 0.1);
}

/* Teacher Selection Row */
.teacher-row {
    margin-bottom: 15px;
}

.teacher-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.teacher-box label {
    font-weight: bold;
    white-space: nowrap;
    color: #6b4423;
}

.teacher-box select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(212, 165, 116, 0.4);
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #6b4423;
    transition: all 0.3s ease;
}

.teacher-box select:focus {
    outline: none;
    border-color: rgba(184, 134, 11, 0.6);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 0 0 3px rgba(184, 134, 11, 0.2),
        0 4px 12px rgba(139, 90, 43, 0.1);
}

/* Bottom Section */
.bottom-section {
    display: flex;
    gap: 15px;
}

.unit-box {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
}

.unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #6b4423;
}

.btn-add {
    background: rgba(212, 165, 116, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 12px rgba(139, 90, 43, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-add:hover {
    background: rgba(184, 134, 11, 0.9);
    transform: scale(1.1);
    box-shadow: 
        0 6px 16px rgba(139, 90, 43, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.unit-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.unit-item {
    padding: 12px;
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #6b4423;
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.08);
}

.unit-item:hover {
    background: rgba(244, 228, 188, 0.5);
    border-color: rgba(184, 134, 11, 0.5);
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(139, 90, 43, 0.12);
}

.unit-item.active {
    background: rgba(212, 165, 116, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #fff;
    border-color: rgba(139, 90, 43, 0.5);
    font-weight: bold;
    box-shadow: 
        0 4px 16px rgba(139, 90, 43, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Files Box */
.files-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #6b4423;
}

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

.trash-download-arrow {
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 3px rgba(139, 90, 43, 0.3));
}

.trash-download-arrow:hover {
    transform: scale(1.2);
}

.trash-icon {
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 3px rgba(139, 90, 43, 0.3));
}

.trash-icon:hover {
    transform: scale(1.2);
}

.trash-icon.drag-over {
    transform: scale(1.3);
    filter: drop-shadow(0 0 10px rgba(184, 70, 11, 0.8));
}

.trash-icon.active {
    background: rgba(184, 134, 11, 0.3);
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(184, 134, 11, 0.4);
}

.files-dropzone {
    flex: 1;
    border: 2px dashed rgba(212, 165, 116, 0.4);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    min-height: 400px;
    background: rgba(255, 249, 230, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.files-dropzone.drag-over {
    border-color: rgba(184, 134, 11, 0.6);
    background: rgba(244, 228, 188, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 
        inset 0 0 30px rgba(184, 134, 11, 0.15),
        0 4px 16px rgba(139, 90, 43, 0.1);
}

.dropzone-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #8b5a2b;
    text-align: center;
    pointer-events: none;
    font-size: 16px;
}

.dropzone-placeholder.hidden {
    display: none;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
    margin-bottom: 10px;
}

.btn-add-file {
    background: rgba(212, 165, 116, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 26px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 16px rgba(139, 90, 43, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    align-self: center;
    margin-top: 10px;
    flex-shrink: 0;
}

.btn-add-file:hover {
    background: rgba(184, 134, 11, 0.9);
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px rgba(139, 90, 43, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.file-item {
    position: relative;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: move;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.08);
}

.file-item:hover {
    border-color: rgba(184, 134, 11, 0.5);
    box-shadow: 
        0 6px 20px rgba(139, 90, 43, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.6);
}

.file-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.file-item.deleted {
    opacity: 0.5;
    border-color: #8b5a2b;
}

.file-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.file-link:hover {
    text-decoration: none;
}

.file-icon {
    font-size: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 3px rgba(139, 90, 43, 0.2));
}

.file-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 3px rgba(139, 90, 43, 0.2));
}

.file-preview {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(212, 165, 116, 0.3);
    box-shadow: 0 2px 5px rgba(139, 90, 43, 0.2);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    word-break: break-word;
    color: #6b4423;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 3px;
}

.file-size {
    font-size: 11px;
    color: #8b5a2b;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: rgba(255, 249, 230, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 12px;
    box-shadow: 
        0 8px 32px rgba(139, 90, 43, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    display: none;
    z-index: 1000;
    min-width: 220px;
    overflow: hidden;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b4423;
    border-bottom: 1px solid rgba(244, 228, 188, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background: rgba(244, 228, 188, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.context-menu-item[data-action="delete"] {
    color: #8b4513;
    font-weight: 500;
}

.context-menu-item[data-action="restore"] {
    color: #6b4423;
    font-weight: 500;
}

.context-menu-separator {
    height: 1px;
    background: #d4a574;
    margin: 5px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(107, 68, 35, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 249, 230, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(212, 165, 116, 0.3);
    box-shadow: 
        0 8px 32px rgba(139, 90, 43, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #8b5a2b;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #6b4423;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #6b4423;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #6b4423;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(212, 165, 116, 0.4);
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #6b4423;
    transition: all 0.3s ease;
}

.modal-content select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-content input:focus,
.modal-content select:focus {
    outline: none;
    border-color: rgba(184, 134, 11, 0.6);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 
        0 0 0 3px rgba(184, 134, 11, 0.2),
        0 4px 12px rgba(139, 90, 43, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    font-weight: 500;
}

.modal-buttons button[type="submit"] {
    background: rgba(212, 165, 116, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 12px rgba(139, 90, 43, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.modal-buttons button[type="submit"]:hover {
    background: rgba(184, 134, 11, 0.9);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(139, 90, 43, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.modal-buttons .btn-cancel {
    background: rgba(244, 228, 188, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #6b4423;
    border: 1px solid rgba(212, 165, 116, 0.4);
}

.modal-buttons .btn-cancel:hover {
    background: rgba(232, 213, 183, 0.8);
}

/* Scrollbar Styling */
.unit-list::-webkit-scrollbar,
.files-list::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.unit-list::-webkit-scrollbar-track,
.files-list::-webkit-scrollbar-track {
    background: rgba(244, 228, 188, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 5px;
}

.unit-list::-webkit-scrollbar-thumb,
.files-list::-webkit-scrollbar-thumb {
    background: rgba(212, 165, 116, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.unit-list::-webkit-scrollbar-thumb:hover,
.files-list::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 134, 11, 0.7);
}

/* Medienbildung Box */
.medienbildung-box {
    flex: 0 0 200px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(244, 228, 188, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #6b4423;
    box-shadow: 
        0 4px 12px rgba(139, 90, 43, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
}

.medienbildung-box:hover {
    background: rgba(244, 228, 188, 0.8);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(139, 90, 43, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.medienbildung-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.medienbildung-pdf-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(139, 90, 43, 0.2));
}

/* Tablet und Mobile Responsive */
@media (max-width: 1024px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
        max-width: 100%;
    }
    
    .top-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .mediaplan-box {
        flex: 1 1 100%;
        min-width: 0;
    }
    
    .teacher-box {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }
    
    .medienbildung-box {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }
    
    .bottom-section {
        flex-direction: column;
    }
    
    .unit-box {
        flex: 1 1 100%;
        min-height: 200px;
    }
    
    .files-box {
        flex: 1 1 100%;
        min-height: 400px;
    }
    
    .modal-content {
        max-width: 90%;
        padding: 20px;
    }
    
    .context-menu {
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .top-row {
        flex-direction: column;
    }
    
    .mediaplan-box,
    .teacher-box,
    .medienbildung-box {
        flex: 1 1 100%;
    }
    
    .teacher-row {
        margin-bottom: 10px;
    }
    
    .class-box {
        flex: 1 1 100%;
    }
    
    .unit-box {
        min-height: 150px;
    }
    
    .files-box {
        min-height: 300px;
    }
    
    .files-dropzone {
        min-height: 250px;
    }
    
    .trash-container {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .modal-content input,
    .modal-content select {
        font-size: 14px;
        padding: 10px;
    }
}
