/* =====================================================
   EDIT MEDIA PAGE STYLES (Shared: Edit Video + Edit Music)
   ===================================================== */

/* Main Page Wrapper (same pattern as .settings-panel) */
.edit-media-page {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* 2-Column Layout: Form (2fr) + Sidebar (1fr) */
.edit-media-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 992px) {
    .edit-media-layout {
        grid-template-columns: 1fr;
    }
}

/* Form Section */
.edit-media-form-section {
    min-width: 0;
}

/* Sidebar */
.edit-media-sidebar {
    position: sticky;
    top: 80px;
}

/* Actions Bar (Save, Delete, Add Card buttons) */
.edit-media-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 20px;
    margin-top: 10px;
}

/* Night Mode - Page Wrapper */
.night-mode .edit-media-page {
    background: #1e1e1e;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* =====================================================
   EDIT VIDEO PAGE - Hero Colors (Blue/Purple)
   ===================================================== */
.edit-video-page .general-hero {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #EDE9FE 100%);
}
.edit-video-page .general-hero-icon {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}
.night-mode .edit-video-page .general-hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}

/* =====================================================
   EDIT MUSIC PAGE - Hero Colors (Orange/Amber)
   ===================================================== */
.edit-music-page .general-hero {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
}
.edit-music-page .general-hero-icon {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.3);
}
.night-mode .edit-music-page .general-hero {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 88, 12, 0.15) 100%);
}

/* =====================================================
   SECTION SVG ICON COLORS
   ===================================================== */

/* Video Details - Blue */
.edit-video-page .edit-section-details .general-section-header svg {
    color: #3B82F6;
}

/* Music Details - Orange */
.edit-music-page .edit-section-details .general-section-header svg {
    color: #f97316;
}

/* Privacy & Settings - Green */
.edit-section-privacy .general-section-header svg {
    color: #10B981;
}

/* Monetization - Purple */
.edit-section-monetization .general-section-header svg {
    color: #8B5CF6;
}

/* Movie Details - Amber (admin) */
.edit-section-movie .general-section-header svg {
    color: #f59e0b;
}

/* =====================================================
   RADIO GROUP STYLING (inside general-form-field)
   ===================================================== */
.edit-media-page .general-form-field .pt_vdo_cstm_radio {
    display: inline-block;
    margin-right: 5px;
}

/* =====================================================
   TOGGLE SWITCH (checkbox-based, no JS needed)
   ===================================================== */

/* Toggle field layout — label left, toggle right */
.edit-media-page .toggle-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.edit-media-page .toggle-field > label {
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

/* Hide the actual checkbox */
.edit-toggle input[type="checkbox"] {
    display: none;
}

/* Track (background pill) */
.edit-toggle-trail {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    background: #888;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s ease;
}

/* Handle (circle) */
.edit-toggle-handler {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Checked state — green + slide right */
.edit-toggle input[type="checkbox"]:checked + .edit-toggle-trail {
    background: #16a085;
}

.edit-toggle input[type="checkbox"]:checked + .edit-toggle-trail .edit-toggle-handler {
    transform: translateX(22px);
}

/* Night mode toggle */
.night-mode .edit-toggle-trail {
    background: #555;
}

.night-mode .edit-toggle input[type="checkbox"]:checked + .edit-toggle-trail {
    background: #16a085;
}

.night-mode .edit-media-page .toggle-field > label {
    color: #cbd5e1;
}

/* =====================================================
   EDIT MUSIC - Music Info Stats (moved from inline CSS)
   ===================================================== */
.music-info-stats {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.music-info-stats .music-stat-row {
    margin-bottom: 10px;
    color: #fff;
}

.music-info-stats .music-stat-row:last-child {
    margin-bottom: 0;
}

.music-info-stats .music-stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.music-info-stats .music-stat-value {
    color: #fff;
}

.music-info-stats .music-stat-divider {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* =====================================================
   EDIT MUSIC - Audio Trim Button (moved from inline CSS)
   ===================================================== */
.music-trim-btn-wrapper {
    margin-bottom: 20px;
}

#openAudioTrimBtn {
    background: linear-gradient(135deg, #ff6600, #ff8800);
    border: none;
    padding: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =====================================================
   EDIT MUSIC - Cover Upload Modal (moved from inline CSS)
   ===================================================== */
#changeCoverModal .modal-dialog {
    max-width: 800px;
}

#changeCoverModal .modal-content {
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
}

#changeCoverModal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
}

#changeCoverModal .modal-title {
    color: #fff;
    font-weight: 600;
}

#changeCoverModal .modal-title svg {
    vertical-align: middle;
    margin-right: 10px;
}

#changeCoverModal .close {
    color: #fff;
    opacity: 0.7;
}

#changeCoverModal .modal-body {
    padding: 30px;
}

/* Cover Upload Area */
.music-cover-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.music-cover-upload-area:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.music-cover-upload-area svg {
    margin-bottom: 20px;
}

.music-cover-upload-area h4 {
    color: #fff;
    margin-bottom: 10px;
}

.music-cover-upload-area .upload-subtitle {
    color: rgba(255, 255, 255, 0.6);
}

.music-cover-upload-area .upload-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-top: 10px;
}

/* Cropper Area */
.music-cropper-area {
    display: none;
    margin-top: 20px;
}

.music-cropper-container {
    max-height: 400px;
    overflow: hidden;
    border-radius: 10px;
}

.music-cropper-container img {
    max-width: 100%;
    display: block;
}

.music-cropper-actions {
    margin-top: 20px;
    text-align: center;
}

.music-cropper-actions .btn {
    margin: 0 5px;
}

/* =====================================================
   EDIT MUSIC - Audio Trim Modal (moved from inline CSS)
   ===================================================== */
#audioTrimModal .modal-dialog {
    max-width: 95%;
    width: 95%;
}

#audioTrimModal .modal-content {
    background: #1a1a1a;
    border: none;
    border-radius: 15px;
    position: relative;
}

#audioTrimModal .modal-body {
    padding: 0;
    border-radius: 15px;
    overflow: hidden;
}

/* Audio Trim Close Button (replaces inline + onmouseover/onmouseout) */
.audio-trim-close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 1;
}

.audio-trim-close-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
    transform: rotate(90deg);
}

.audio-trim-close-btn span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

/* Audio Trim Container - override spacing */
#audioTrimModal .modern-audio-trim-container {
    margin: 0;
    border-radius: 0;
}

/* Hidden audio element */
#trimAudioPreview {
    display: none;
}

/* Hidden file input (cover) */
#coverInput {
    display: none;
}

/* =====================================================
   BUTTON SIZING (replaces .pt_forms_large_btns effect)
   ===================================================== */
.edit-media-actions .setting-panel-mdbtn {
    padding: 0 20px;
    height: 40px !important;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    box-shadow: none;
    margin: 0;
}

/* =====================================================
   NIGHT MODE - .pp_mat_input inside edit-media-page
   (No night mode exists globally for pp_mat_input)
   ===================================================== */

/* Input & Textarea */
.night-mode .edit-media-page .pp_mat_input input,
.night-mode .edit-media-page .pp_mat_input textarea {
    color: #e0e0e0;
    border-color: #3d3d4a;
}

.night-mode .edit-media-page .pp_mat_input input:focus,
.night-mode .edit-media-page .pp_mat_input textarea:focus {
    border-color: #04abf2;
}

/* Floating Label - match .general-section night bg */
.night-mode .edit-media-page .pp_mat_input label {
    background-color: #1e1e2d;
    color: rgba(255, 255, 255, 0.7);
}

/* Placeholder-shown label - transparent when inside input */
.night-mode .edit-media-page .pp_mat_input input:placeholder-shown:not(:focus) + label {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.38);
}

/* Select */
.night-mode .edit-media-page .pp_mat_input select {
    background: #1e1e2d;
    color: #e0e0e0;
    border-color: #3d3d4a;
}

.night-mode .edit-media-page .pp_mat_input select:focus {
    border-color: #04abf2;
}

/* Bootstrap-Select Button */
.night-mode .edit-media-page .pp_mat_input > .bootstrap-select > button {
    background: #1e1e2d;
    border-color: #3d3d4a;
    color: rgba(255, 255, 255, 0.7) !important;
}

.night-mode .edit-media-page .pp_mat_input > .bootstrap-select.open > .dropdown-toggle {
    background: #1e1e2d;
    border-color: #04abf2;
}

/* Bootstrap-Select Dropdown */
.night-mode .edit-media-page .pp_mat_input > .bootstrap-select > .dropdown-menu {
    background: #1e1e2d;
    border-color: #3d3d4a;
}

.night-mode .edit-media-page .pp_mat_input > .bootstrap-select .dropdown-menu li a {
    color: rgba(255, 255, 255, 0.8);
}

/* EmojioneArea */
.night-mode .edit-media-page .pp_mat_input .emojionearea {
    border-color: #3d3d4a;
}

.night-mode .edit-media-page .pp_mat_input .emojionearea .emojionearea-editor {
    color: #e0e0e0;
}

/* Tag-it */
.night-mode .edit-media-page .pp_mat_input ul.tagit {
    border-color: #3d3d4a;
}

/* Help Block */
.night-mode .edit-media-page .pp_mat_input .help-block,
.night-mode .edit-media-page .help-block {
    color: rgba(255, 255, 255, 0.5);
}

/* Form Field Labels (radio groups etc.) */
.night-mode .edit-media-page .general-form-field > label {
    color: rgba(255, 255, 255, 0.8);
}

/* Radio Button Labels */
.night-mode .edit-media-page .pt_vdo_cstm_radio label {
    color: rgba(255, 255, 255, 0.7);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .edit-media-page {
        padding: 15px;
        border-radius: 0;
    }

    .edit-media-actions {
        flex-direction: column;
    }

    .edit-media-actions .btn {
        width: 100%;
    }

    .music-info-stats {
        margin-top: 15px;
    }
}
