/* ==========================================================================
   AI Content Generator - Main Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. RESET & BASE STYLES
   ========================================================================== */

   body {
    font-family: 'Montserrat', Arial, sans-serif;
    color: #333;
    background: none !important;
    background-color: transparent !important;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container-fluid {
    padding: 0;
}

/* ==========================================================================
   2. NAVIGATION
   ========================================================================== */

.main-nav {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    height: 58px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1500px;
    padding: 0 20px;
    position: relative;
}

.nav-logo-container {
    position: absolute;
    inset-inline-start: 20px;
}

.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.nav-auth {
    position: absolute;
    inset-inline-end: 20px;
}

.nav-logo {
    height: 30px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #51828E;
}

.nav-links a.active {
    font-weight: 600;
    color: #5E35B1;
    border-bottom: 2px solid #5E35B1;
    padding-bottom: 4px;
}

.nav-links a[href="/sell"] {
    margin-right: 20px;
}

.nav-links a[href="/sell"] i {
    margin-inline-start: 8px;
    font-size: 12px;
}

.nav-links a[href="/learn-ai"] i {
    margin-inline-start: 6px;
    font-size: 10px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    padding: 8px;
    position: absolute;
    inset-inline-start: 20px;
    z-index: 101;
    transition: color 0.2s ease;
}

.mobile-menu-toggle:hover {
    color: #51828E;
}

.mobile-menu-toggle i {
    display: inline-block;
}

.mobile-menu-toggle .fa-times {
    display: none;
}

.mobile-menu-toggle.active .fa-bars {
    display: none;
}

.mobile-menu-toggle.active .fa-times {
    display: inline-block;
}

.auth-buttons {
    display: flex;
    gap: 8px;
}

.btn-login {
    color: #333;
    padding: 6px 16px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.btn-login:hover {
    color: #51828E;
    text-decoration: none;
}

.btn-sign-up {
    background-color: #5E35B1;
    color: white;
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.btn-sign-up:hover {
    background-color: #4527a0;
    color: white;
    text-decoration: none;
}

/* ==========================================================================
   3. HEADER SECTION
   ========================================================================== */

.header-section {
    background-color: #2e0043;
    color: #51828E;
    padding: 30px 20px;
    text-align: start;
}

.header-section h1.main-heading {
    color: #51828E;
    font-family: 'Oxygen', sans-serif;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    line-height: 1.1;
}

.subtitle {
    font-size: 1rem;
    margin-bottom: 20px;
    opacity: 0.9;
    color: #51828E;
}

.highlight {
    font-style: italic;
}

/* Credits section styling within header */
.credits-section {
    margin-top: 20px;
}

.credits-section p {
    margin: 0;
    font-size: 0.95rem;
    color: #51828E;
}

#credit_count {
    background-color: rgba(81, 130, 142, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid rgba(81, 130, 142, 0.3);
    display: inline-block;
    font-weight: 500;
    color: #51828E;
}

/* ==========================================================================
   4. MAIN CONTENT & LAYOUT
   ========================================================================== */

.content-container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Main two-column layout using grid */
.content-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
  }
  
  /* Main two-column layout using grid */
  .two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
  }
  
  .left-column,
  .right-column {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
/* Remove grid placement for form/button-group */
#duration_group, .button-group {
    grid-column: unset;
}

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

/* ==========================================================================
   5. PREVIEW BUTTON
   ========================================================================== */

.preview-toggle {
    position: absolute;
    top: 20px;
    inset-inline-end: 20px;
    z-index: 10;
}

#preview_button {
    background-color: white;
    border: 1px solid rgba(0,0,0,0.2);
    color: #333;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#preview_button:hover {
    background-color: #f8f9fa;
    border-color: rgba(0,0,0,0.3);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#preview_button i {
    font-size: 14px;
    color: #5E35B1;
}

.preview-area {
    margin-top: 60px;
    width: 100%;
}

.preview-placeholder {
    width: 100%;
    max-width: 600px;
    min-height: 300px;
    background-color: #000;
    border-radius: 8px;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.preview-placeholder.has-content {
    background-color: #000;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.preview-placeholder .result-box {
    width: 100%;
    height: 100%;
    min-height: 300px;
    max-height: 600px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.preview-placeholder .result-box img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.preview-placeholder .result-box video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* 3D model viewer size */
.preview-placeholder .result-box model-viewer {
    width: 100%;
    height: 300px;
    border-radius: 8px;
}

.preview-placeholder .action-buttons {
    position: absolute;
    bottom: 10px;
    inset-inline-end: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    padding: 8px;
}

.preview-placeholder:not(.has-content)::before {
    content: 'Preview will appear here';
    color: #666;
}

.price-info {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.price-info p {
    margin: 0;
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
}

.price-info strong {
    color: #5E35B1;
}

/* ==========================================================================
   6. FORM STYLES
   ========================================================================== */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 30px;
    margin-right: 0;
    margin-left: 0;
}

.form-group {
    margin-bottom: 20px;
    padding-inline: 15px;
}

.form-group.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-inline: 0;
    margin-bottom: 20px;
}

.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 12px;
    width: 100%;
    box-shadow: none;
    transition: all 0.15s ease-in-out;
    font-size: 14px;
}

input.form-control,
select.form-control {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-control:focus {
    border-color: #5E35B1;
    box-shadow: 0 0 0 0.2rem rgba(94, 53, 177, 0.25);
    outline: none;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #333;
    font-size: 14px;
}

select.form-control {
    background-color: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    height: 48px;
    min-height: 48px;
    padding-right: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* LTR: Custom dropdown appearance */
[dir="ltr"] select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%235E35B1' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}

/* ============================================================================
   RTL SELECT FIX - CHROMIUM BUG WORKAROUND (NUCLEAR APPROACH)
   Issue: In RTL mode with appearance:none, Chromium shows select as listbox (only 5 items visible)
   Solution: Force native dropdown with menulist-button using MAXIMUM specificity
   ============================================================================ */

/* Target EVERY possible select element with ultra-high specificity */
body[dir="rtl"] select,
html[dir="rtl"] select,
[dir="rtl"] select,
div[dir="rtl"] select,
body[dir="rtl"] select.form-control,
html[dir="rtl"] select.form-control,
[dir="rtl"] select.form-control,
div[dir="rtl"] select.form-control,
body[dir="rtl"] #generation_type,
html[dir="rtl"] #generation_type,
[dir="rtl"] #generation_type,
div.container-fluid[dir="rtl"] select,
div.container-fluid[dir="rtl"] select.form-control,
div.container-fluid[dir="rtl"] #generation_type {
    appearance: menulist-button !important;
    -webkit-appearance: menulist-button !important;
    -moz-appearance: menulist-button !important;
    background-image: none !important;
    background: none !important;
    padding-right: 12px !important;
    padding-left: 40px !important;
}

/* Remove any custom arrow in RTL */
body[dir="rtl"] select::after,
html[dir="rtl"] select::after,
[dir="rtl"] select::after {
    display: none !important;
    content: none !important;
}

select.form-control:hover {
    border-color: #51828E;
    box-shadow: 0 2px 4px rgba(81, 130, 142, 0.1);
}

select.form-control:focus {
    border-color: #51828E;
    box-shadow: 0 0 0 3px rgba(81, 130, 142, 0.1);
}

/* Dropdown hover color */
select.form-control option:hover,
select.form-control option:focus,
select.form-control option:checked {
    background-color: #51828E !important;
    color: white;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    overflow-y: auto;
}

/* ==========================================================================
   7. BUTTON STYLES
   ========================================================================== */

.btn {
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-inline-end: 10px;
    border: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.btn-primary {
    background-color: #5E35B1;
    color: white;
}

.btn-primary:hover {
    background-color: #4527a0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-light {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #212529;
}

/* (Removed) RTL SUPPORT block */

.btn-light:hover {
    background-color: #e2e6ea;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
}

.button-group {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

/* ==========================================================================
   8. IMAGE & VIDEO SLOTS
   ========================================================================== */

.image-slot, .video-slot {
    width: 130px;
    height: 130px;
    border: 2px dashed #ced4da;
    margin: 8px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.image-slot:hover, .video-slot:hover {
    border-color: #5E35B1;
    background-color: #f1f1f1;
}

.image-slot img, .video-slot video {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.slot-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 8px;
    font-size: 12px;
    text-align: center;
    font-weight: 500;
}

.image-slot:empty::before, .video-slot:empty::before {
    content: '+';
    font-size: 2.5rem;
    color: #ced4da;
    font-weight: 300;
}

/* ==========================================================================
   9. RESULTS CONTAINER
   ========================================================================== */

.result-box {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    margin-top: 60px;
}

.result-content {
    background-color: #000;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.result-content img, .result-content video {
    width: 100%;
    display: block;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ==========================================================================
   10. CREDITS & BUY SECTION
   ========================================================================== */

.credits-promo-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    margin-top: 40px;
    text-align: center;
}

.credits-promo-content {
    max-width: 600px;
    margin: 0 auto;
}

.credits-promo-box h3 {
    color: #5E35B1;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 700;
}

.credits-promo-box p {
    margin-bottom: 15px;
    color: #333;
    font-size: 1rem;
}

.pricing-info {
    background-color: #e9f7ef;
    border-left: 4px solid #28a745;
    padding: 15px 20px;
    margin: 20px 0;
    font-size: 0.95rem;
    color: #333;
    border-radius: 4px;
}

.credits-promo-box .btn {
    margin-top: 20px;
}

/* ==========================================================================
   11. ERROR & LOADING MESSAGES
   ========================================================================== */

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
}

#loading_message {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* ==========================================================================
   12. UTILITY CLASSES
   ========================================================================== */

.required-note {
    font-size: 12px;
    color: #dc3545;
    margin-top: 5px;
    font-style: italic;
}

.file-size-note, .video-file-size-note {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.text-muted {
    color: #6c757d;
}

.small {
    font-size: 0.875rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* ==========================================================================
   13. SLIDER STYLES
   ========================================================================== */

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #5E35B1;
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #5E35B1;
    cursor: pointer;
    border: none;
}

.slider-container span {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    min-width: 80px;
}

/* ==========================================================================
   14. FOOTER
   ========================================================================== */

.site-footer {
    background-color: #2e0043;
    color: white;
    padding: 30px 20px;
    margin-top: 50px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #51828E;
}

.footer-copyright, .footer-powered {
    text-align: center;
    font-size: 12px;
    opacity: 0.8;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 15px;
    padding-left: 15px;
}

/* ==========================================================================
   15. RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1500px) {
    .main-layout {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    .left-column, .right-column {
        width: 100%;
        max-width: 800px;
        margin: 0 auto 20px auto;
        flex: 1 1 100%;
        min-width: 0;
    }
    
    .preview-toggle {
        position: static;
        text-align: right;
        margin-bottom: 20px;
    }
    
    .nav-content {
        max-width: 1200px;
    }
}

@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .form-group.col-md-6 {
        padding-right: 0;
        padding-left: 0;
    }
    
    .nav-links {
        gap: 25px;
    }
    
    .header-section h1.main-heading {
        font-size: 2.5rem;
    }
    
    .left-column, .right-column {
        padding: 20px;
    }

    .main-layout {
        flex-direction: column;
        gap: 0;
    }
    .left-column, .right-column {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .header-section {
        padding: 20px 15px;
    }
    
    .header-section h1.main-heading {
        font-size: 2rem;
    }
    
    .content-container {
        padding: 15px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-content {
        flex-direction: column;
        padding: 10px 20px;
        position: relative;
    }
    
    .nav-logo-container {
        position: static;
        margin-bottom: 15px;
    }
    
    .nav-center {
        position: static;
        width: 100%;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 15px;
        width: 100%;
        margin-bottom: 15px;
        padding: 20px 0;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .nav-auth {
        position: static;
    }
    
    .auth-buttons {
        gap: 15px;
        justify-content: center;
    }
    
    .button-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center;
    }
    
    .credits-promo-box {
        padding: 20px;
    }
    
    .main-nav {
        height: auto;
    }
    
    /* Stack columns on medium screens */
    .main-layout {
        flex-direction: column;
    }
    
    .left-column, .right-column {
        width: 100%;
        flex: 1 1 100%;
    }
}

@media (max-width: 576px) {
    .header-section {
        padding: 15px 10px;
    }
    
    .header-section h1.main-heading {
        font-size: 1.6rem;
    }
    
    .content-container {
        padding: 10px;
    }
    
    .image-slot, .video-slot {
        width: 120px;
        height: 120px;
        margin: 5px;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .left-column, .right-column {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    #credit_count {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    /* Stack columns on very small screens */
    .main-layout {
        flex-direction: column;
    }
    
    .left-column, .right-column {
        width: 100%;
        flex: 1 1 100%;
    }
} 

.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: flex-start;
    width: 100%;
    margin-top: 32px;
}
@media (max-width: 992px) {
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Toggle Switch Styles for Suno Music Generation */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #9c27b0;
}

input:checked + .slider:before {
    transform: translateX(26px);
}