/* ====================================
   ADD ASSET MODAL STYLES
   ==================================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

/* Modal Container */
.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #dc3545;
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Modal Folder Container */
.modal-folder-container {
    border-right: 2px solid #e0e0e0;
    padding-right: 1.5rem;
}

.modal-folder-container h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.selected-folder-display {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.selected-folder-display label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.selected-folder-display span {
    color: #007bff;
    font-weight: 500;
}

/* Modal Form Container */
.modal-form-container {
    max-width: 700px;
}

/* Form Styles */
.modal-form-container .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-form-container .form-group {
    display: flex;
    flex-direction: column;
}

.modal-form-container .form-group.full-width {
    grid-column: 1 / -1;
}

.modal-form-container .form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.modal-form-container .form-group input,
.modal-form-container .form-group select,
.modal-form-container .form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.modal-form-container .form-group input:focus,
.modal-form-container .form-group select:focus,
.modal-form-container .form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.modal-form-container .form-group input:disabled,
.modal-form-container .form-group select:disabled,
.modal-form-container .form-group textarea:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-form-container .btn-save:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-form-container .btn-save:disabled:hover {
    background: #6c757d;
}

/* Form Buttons */
.modal-form-container .form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

.modal-form-container .btn-cancel,
.modal-form-container .btn-save {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-form-container .btn-cancel {
    background: #6c757d;
    color: white;
}

.modal-form-container .btn-cancel:hover {
    background: #5a6268;
}

.modal-form-container .btn-save {
    background: #007bff;
    color: white;
}

.modal-form-container .btn-save:hover {
    background: #0056b3;
}

/* Folder Selection Highlight in Modal */
#modalFolderTree .folder-selected {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .modal-folder-container {
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .modal-form-container .form-row {
        grid-template-columns: 1fr;
    }
}

/* ====================================
   FOLDER MANAGEMENT STYLES
   ==================================== */

/* Folder tree buttons */
.folder-content {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    margin-bottom: 4px;
    border-radius: 6px;
    transition: background-color 0.2s;
    min-height: 36px;
}

.folder-content:hover {
    background-color: #f0f0f0;
}

.folder-name {
    flex: 1;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #2c3e50;
    padding: 0 8px;
    line-height: 1.5;
}

.folder-icon {
    margin-right: 6px;
    font-size: 11px;
    color: #666;
    min-width: 16px;
    display: inline-block;
    text-align: center;
}

.folder-icon.rotate {
    transition: transform 0.2s;
}

.folder-icon.rotate.open {
    transform: rotate(90deg);
}

.subfolder-container {
    margin-left: 20px;
    margin-top: 2px;
}

.subfolder-container.collapsed {
    display: none;
}

.add-btn, .delete-btn {
    padding: 0;
    margin-left: 6px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.add-btn {
    background: #667eea;
    color: white;
    line-height: 1;
}

.add-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.delete-btn {
    background: #dc3545;
    color: white;
    padding: 4px;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.delete-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* Folder instructions */
.folder-instructions {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Popup overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.popup-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    text-align: center;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.popup-container h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.popup-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.popup-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.asset-btn {
    background: #667eea;
    color: white;
}

.asset-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.folder-btn {
    background: #48bb78;
    color: white;
}

.folder-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.popup-close {
    width: 100%;
    padding: 0.75rem;
    background: #e2e8f0;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.popup-close:hover {
    background: #cbd5e0;
}

/* Delete popup specific styles */
.delete-popup .delete-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.delete-popup .warning-text {
    color: #dc3545;
    font-weight: 600;
    margin-top: 0.5rem;
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.confirm-delete-btn {
    background: #dc3545;
    color: white;
}

.confirm-delete-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Success popup */
.success-popup .success-icon {
    width: 60px;
    height: 60px;
    background: #48bb78;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.success-popup .success-icon::before {
    content: '✓';
}

.success-btn {
    background: #48bb78;
    color: white;
    width: 100%;
}

.success-btn:hover {
    background: #38a169;
}

/* Error popup */
.error-popup .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-btn {
    background: #dc3545;
    color: white;
    width: 100%;
}

.error-btn:hover {
    background: #c82333;
}

/* Rename input */
.rename-input {
    flex: 1;
    padding: 4px 8px;
    border: 2px solid #667eea;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}