/* Edit Modal Styles */
.edit-modal-content {
    max-width: 800px !important;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.edit-modal-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.edit-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.edit-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.edit-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.edit-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.edit-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.edit-modal-body {
    padding: 0;
}

.edit-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.edit-form-content {
    padding: 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Section Styles */
.current-media-section,
.new-media-section,
.caption-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.current-media-section:hover,
.new-media-section:hover,
.caption-section:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.section-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

/* Current Media Display */
.current-media-display {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px dashed #d1d5db;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-media-display img,
.current-media-display video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Upload Zone */
.upload-zone-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modern-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    position: relative;
    overflow: hidden;
}

.modern-upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 107, 107, 0.05) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-upload-zone:hover {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.1);
}

.modern-upload-zone:hover::before {
    opacity: 1;
}

.upload-zone-content {
    position: relative;
    z-index: 1;
}

.upload-icon-wrapper {
    margin-bottom: 16px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 8px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.upload-text {
    margin-bottom: 16px;
}

.upload-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.upload-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.upload-link {
    color: #ff6b6b;
    font-weight: 500;
    text-decoration: underline;
}

.upload-formats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.format-tag {
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Media Preview */
.media-preview-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.remove-preview-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-preview-btn:hover {
    background: #fecaca;
    border-color: #f87171;
}

.preview-content {
    padding: 20px;
    text-align: center;
}

.preview-content img,
.preview-content video {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Caption Section */
.caption-input-wrapper {
    position: relative;
}

.caption-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: inherit;
}

.caption-textarea:focus {
    outline: none;
    border-color: #ff6b6b;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.caption-counter {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 12px;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

/* Form Actions */
.form-actions {
    background: #f9fafb;
    padding: 24px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 20px 20px;
}

.btn-secondary,
.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff7979 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(255, 107, 107, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .edit-modal-content {
        width: 95vw;
        max-height: 95vh;
        margin: 2.5vh auto;
        border-radius: 16px;
    }
    
    .edit-modal-header {
        padding: 20px 24px;
        border-radius: 16px 16px 0 0;
    }
    
    .edit-header-content {
        gap: 12px;
    }
    
    .edit-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .edit-close-btn {
        top: 20px;
        right: 20px;
        width: 36px;
        height: 36px;
    }
    
    .edit-form-content {
        padding: 24px 20px;
        gap: 24px;
    }
    
    .current-media-section,
    .new-media-section,
    .caption-section {
        padding: 20px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .section-subtitle {
        font-size: 13px;
    }
    
    .modern-upload-zone {
        padding: 30px 16px;
    }
    
    .upload-icon {
        font-size: 40px;
    }
    
    .upload-title {
        font-size: 16px;
    }
    
    .form-actions {
        padding: 20px;
        flex-direction: column-reverse;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Loading States */
.btn-primary:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled::before {
    display: none;
}

/* Success Animation */
@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-primary.success {
    animation: success-pulse 0.3s ease;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

/* Hidden class utility */
.hidden {
    display: none !important;
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}