#center-container {
    position: relative; 
    display: block; 
    width: 68vw;
    max-width: 2000px;
    min-width: 320px;
    height: 100vh;
    max-height: 1100px;
    min-height: 400px;
    margin-right: 20px;
    border-radius: 10px;
    background: transparent;
}

#page-title {
    font-family: 'Arial', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    text-align: center;
    margin: 0 auto 0px auto;
    max-width: 90%;
    user-select: none;
    background: linear-gradient(90deg, #4a90e2, #70a1ff, #4a90e2, #a0c4ff, #4a90e2);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-move 4s linear infinite;
    background-clip: text;
    text-fill-color: transparent;
        text-shadow:
        0 0 4px rgba(58, 123, 197, 0.4),
        0 0 8px rgba(0, 210, 255, 0.3);
}

@keyframes gradient-move {
    0% {
        background-position: 300% 0;
    }
    100% {
        background-position: 0% 0;
    }
}


@media (max-width: 767px) {
  #page-title {
  display: none;
  }
}


#form-container {
    position: absolute;
    bottom: 0;
    width: 50vw;
    left: 0;
    right: 0;
    margin: 0 auto;
    background-color: transparent; 
    backdrop-filter: none;          
    -webkit-backdrop-filter: none;
    padding: 20px 20px;
    box-shadow: none;               
    z-index: 10;
    border-radius: 0 0 10px 10px; 
    max-height: 40vh; 
    overflow-y: auto;
    box-sizing: border-box;
}

#videos-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 30px;
    bottom: 0;
    padding: 20px 20px 60px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 15px;
    box-sizing: border-box;
    min-height: 0;
    padding-bottom: 180px;
    padding-top: 80px; 
    scrollbar-width: none; 
    -ms-overflow-style: none;  
}

#videos-container::-webkit-scrollbar {
    display: none; 
}

.video-item {
    flex: 0 0 auto;
    max-height: 350px;
    min-height: 280px; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(74,144,226,0.1);
    border-radius: 10px;
    padding: 10px 10px;
    margin-bottom: 15px;
    box-shadow: 0 0 20px rgba(255,255,255,0.6);
    
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(74,144,226,0.8);
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: black;
    border-radius: 8px;
    outline: none;
    box-shadow: 0 0 10px rgba(74,144,226,0.8);
}

form#wan-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

form#wan-form label {
    font-weight: bold;
    flex: 1 1 100%;
    margin-bottom: 6px;
    color: white;
}

.prompt-send-container {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    margin-bottom: 0px;

}

.textarea-upload-wrapper {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.upload-icon-label {
    position: absolute;
    top: 30%;
    left: 0;
    transform: translateY(-50%);
    width: 90px;
    height: 60px;
    border: 2px dashed #4a90e2;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0a1740;
    transition: background-color 0.3s ease;
    user-select: none;
    z-index: 10;
}
.upload-icon-label:hover,
.upload-icon-label:focus {
    background-color: rgba(74, 144, 226, 0.15);
    outline: none;
    box-shadow: 0 0 5px #4a90e2;
}

.upload-icon-box {
    width: 90px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent; 
}

.upload-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px; 
}

.upload-icon-box svg {
    pointer-events: none;
    stroke: #4a90e2;
}

@media (max-width: 767px) {

.upload-icon-label {
    left: 2%;
} 
}

.textarea-button-wrapper {
    right: 15px;
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
}

form#wan-form textarea {
    flex: 1 1 auto;
    min-height: 140px;
    border-radius: 20px;
    border: 1px solid #4a90e2;
    background: #0a1740;
    color: white;
    font-size: 14px;
    font-family: Arial, sans-serif;
    resize: vertical;
    padding-left: 115px !important;
    padding-right: 75px !important;
    padding-top: 14px;
    padding-bottom: 12px;
    line-height: 20px;
    box-sizing: border-box;
    box-shadow: 0 0 10px rgba(255,255,250,0.6);
}

.prompt-send-container button.btn-send {
    flex: 0 0 70px;
    height: 70px;
    padding: 0;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
    background-color: #4a90e2;
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prompt-send-container > button.btn-send {
    display: none;
}

.textarea-button-wrapper > button.btn-send {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 20px;
    padding: 0;
    background-color: #4a90e2;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(74,144,226,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 12;
}

.textarea-button-wrapper > button.btn-send:hover:enabled {
    background-color: #357abd;
}

#sidebar-container-wan {
    position: fixed;
    top: 20px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 200px;
    z-index: 10;

    background: linear-gradient(135deg, rgba(10, 23, 64, 0.95) 0%, rgba(30, 60, 110, 0.85) 100%);
    box-shadow: 0 0 20px rgba(58, 123, 197, 0.7);
    border-radius: 15px;
    padding: 15px;
    padding-top: 0px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(74, 144, 226, 0.3);
    color: white;
}

.duration-row {
    gap: 40px;
}

.duration-options-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.duration-options-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: normal;
}

#form-status {
    margin-top: 0px;
    min-height: 18px;
    font-weight: bold;
    color: #a3efb9;
}

@media (max-width: 767px) {
    .settings-row {
        flex-wrap: wrap;
        gap: 15px;
    }
    .checkbox-row {
        gap: 15px !important;
        margin-top: 10px;
    }
}

#model-sidebar {
    background: rgba(10, 23, 64, 0.8);  
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5); 
    color: white;
    padding: 10px 10px;
    font-family: Arial, sans-serif;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0px;
}

#settings-duration-container {
    background: rgba(10, 23, 64, 0.8);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    padding: 10px 10px;
    color: white;
    font-family: Arial, sans-serif;
    user-select: none;
    margin-bottom: 5px;
}

#model-sidebar .model-btn-chat-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    background-color: rgba(74, 144, 226, 0.2);
    border: none;
    height: 30px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 1px 1px;
    cursor: pointer;
    box-shadow: 0 0 5px #4a90e2 !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
}

.model-btn-chat-link {
    margin-bottom: 0px; 
}
.model-btn-chat-link:last-child {
    margin-bottom: 0px; 
}

.model-btn-chat-link:hover {
    background-color: #4a90e2 !important;
    box-shadow: 0 0 10px #4a90e2 !important;
    outline: none;
}

.model-btn-chat-link:focus {
    background-color: #4a90e2 !important;
    box-shadow: 0 0 10px #4a90e2 !important;
    outline: none;
}

.model-btn-chat-link.active {
    background: linear-gradient(135deg, #00509e, #337acc) !important; 
    box-shadow: 0 0 18px #3399ff !important; 
    color: #ffffff !important;
    font-weight: 700;
    cursor: default;
    pointer-events: auto;
}

#settings-duration-container,
#model-sidebar {
    width: 100%;
    max-width: 420px; 
    box-sizing: border-box;
}

@media (max-width: 767px) {
    #model-sidebar {
        padding: 12px 15px;
        gap: 8px;
    }

    #model-sidebar .model-btn {
        font-size: 14px;
        padding: 8px 12px;
    }
}

.settings-separator {
    border: 0;
    height: 1px;
    background: rgba(74, 144, 226, 0.5);
    margin: 10px 0;
}

.duration-options-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0 5px;
}

.duration-option {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 30px;
    border-radius: 12px;
    background-color: rgba(74, 144, 226, 0.2);
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    color: white;
    user-select: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.duration-label-text {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 30px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    user-select: none;
}

.duration-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.duration-option input[type="radio"]:checked + .duration-label-text {
    background: linear-gradient(135deg, #00509e, #337acc);
    box-shadow: 0 0 5px #3399ff;
    border-radius: 12px;
    display: flex;
    width: 75px;
    height: 30px;
    text-align: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.settings-checkboxes {
    display: flex;
    margin-top: 10px;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start; 
    white-space: nowrap; 
    gap: 8px;
    font-weight: normal;
    font-size: 14px;
    color: white;
    cursor: pointer;
    user-select: none;
}

.checkbox-go-fast-input,
.checkbox-prompt-optimizer-input {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer;
    display: inline-block;
    transform-origin: top left;
    transform: scale(1.3);
}

.checkbox-go-fast-input {
    margin-right: 6px;
}

.checkbox-prompt-optimizer-input {
    margin-right: 6px;
}

.checkbox-go-fast .checkbox-text {
    margin-top: 2px; 
}

.checkbox-prompt-optimizer .checkbox-text {
    margin-top: 2;
}

.checkbox-text small {
    display: block;
    font-size: 12px;
    color: #aaccee;
    line-height: 1.2;
    margin-top: 2px;
    user-select: none;
}

@media (max-width: 767px) {
    #settings-duration-container {
        padding: 10px 10px;
    }
    .duration-options-wrapper {
        gap: 12px;
    }
    .duration-option {
        width: 70px;
        height: 30px;
        font-size: 18px;
    }
    .duration-option input[type="radio"]:checked + .duration-label-text {
        font-size: 18px;
        line-height: 40px;
    }
}

@media (max-width: 767px) {
    #sidebar-container-wan {
        position: fixed;
        top: 0;
        right: -245px; 
        width: 200px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(10, 23, 64, 0.95) 0%, rgba(30, 60, 110, 0.85) 100%);
        box-shadow: 0 0 20px rgba(58, 123, 197, 0.7);
        border-radius: 0 0 0 15px;
        padding: 15px;
        padding-top: 0px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(74, 144, 226, 0.3);
        color: white;
        z-index: 110;
        transition: right 0.3s ease;
        display: flex;
        flex-direction: column;
    }
    #sidebar-container-wan.open {
        right: 0;
        border-radius: 0 0 0 15px;
    }

    #overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 100;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
    #overlay.active {
        display: block;
        opacity: 1;
    }

  #sidebar-toggle-btn {
    position: fixed;
    top: 40%;
    right: 230px;
    width: 32px;
    height: 100px;

    background: linear-gradient(135deg, rgba(10, 23, 64, 0.95) 0%, rgba(30, 60, 110, 0.85) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 15px 0 0 15px;

    border-top: 1px solid rgba(74, 144, 226, 0.3);
    border-left: 1px solid rgba(74, 144, 226, 0.3);
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
    border-right: 1px solid transparent;

    box-shadow: 0 0 20px rgba(58, 123, 197, 0.7);

    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 111;
    transition: right 0.3s ease;
    user-select: none;
    transform-origin: center center;
}
  
     #sidebar-container-wan.open + #sidebar-toggle-btn {
        right: 230px; 
        border-radius: 15px 0 0 15px !important; 
    }
    
    #sidebar-toggle-btn.closed {
    right: 0;
    border-radius: 15px 0 0 15px !important; 
        
    background: linear-gradient(45deg, #3a7bd5, #00d2ff, #3a7bd5, #00d2ff);
    background-size: 300% 300%;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.7);
    color: #fff;
    cursor: pointer;
    animation: gradientShiftVertical 6s ease infinite;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 100px;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

#sidebar-toggle-btn.closed:hover,
#sidebar-toggle-btn.closed:focus {
    box-shadow: 0 0 20px rgba(74, 144, 226, 1);
    outline: none;
    transform: scale(1.03);
    color: #fff;
}

@keyframes gradientShiftVertical {
    0% {
        background-position: 50% 0%;
    }
    50% {
        background-position: 50% 100%;
    }
    100% {
        background-position: 50% 0%;
    }
}
    
#sidebar-icon-left,
#sidebar-icon-right {
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 24px;
    height: 24px;
}

    #sidebar-container-wan.open + #sidebar-toggle-btn #sidebar-icon-open {
        display: none;
    }
    #sidebar-container-wan.open + #sidebar-toggle-btn #sidebar-icon-close {
        display: block;
    }
}


@media (max-width: 767px) {
    #center-container {
        width: 100vw !important;
        max-width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 auto !important;
        padding: 5px 5px !important;
        box-sizing: border-box;
        position: relative; 
        padding-bottom: 45vh !important;
    }

    #balance-warning {
        position: relative !important;
        top: 150px !important;
        left: auto !important;
        transform: none !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 15px 12px !important;
        border-radius: 12px;
        font-size: 16px !important;
        box-sizing: border-box;
        box-shadow: 0 0 10px #4a90e2;
        text-align: center;
        z-index: 10;
        margin-bottom: 15px;
    }

#videos-container {
    position: relative !important; 
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: 75vh !important;
    margin: 0 auto 15px auto !important;
    padding: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow-y: auto !important; 
    box-sizing: border-box;
    -ms-overflow-style: auto !important;
}



    #videos-container::-webkit-scrollbar {
        display: block !important;
        height: 8px !important;
        width: 8px !important;
    }
    
    .video-item {
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        min-height: auto !important;
        padding: 8px 6px !important;
        margin-bottom: 10px !important;
        box-sizing: border-box;
        box-shadow: 0 0 10px rgba(255,255,255,0.6);
    }

.video-wrapper {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(74,144,226,0.8) !important;
}

.video-wrapper video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: inherit !important;
    outline: none !important;
}

    #form-container {
        position: fixed !important;
        bottom: 0px !important;
        left: 0px !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 40vh !important;
        overflow-y: auto !important;
        padding: 0px 0px !important;
        padding-top: -30px !important;
        border-radius: 12px 12px 0 0 !important;
        box-sizing: border-box !important;
        color: white !important;
        font-size: 14px !important;
    }

    form#wan-form {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box;
    }

    form#wan-form textarea {
        width: 100% !important;
        min-height: 120px !important;
        padding-left: 80px !important;
        padding-right: 75px !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
}

    .textarea-button-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
        display: flex !important;
        flex-grow: 1;
    }
    
        .textarea-button-wrapper {
        display: flex !important;
        flex-grow: 1;
        right: 0 !important;       
        margin: 0 auto !important; 
        width: 100% !important;    
        max-width: 100% !important;
        justify-content: center !important; 
        position: relative !important;      
    }
    
    .textarea-button-wrapper textarea {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .textarea-button-wrapper > button.btn-send {
        position: absolute !important;
        top: 50% !important;
        right: 10px !important;
        transform: translateY(-50%) !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 16px !important;
        background: linear-gradient(45deg, #3a7bd5, #00d2ff, #3a7bd5, #00d2ff);
        background-size: 300% 300%;
        background-position: 50% 0%;
        animation: gradientShiftVertical 6s ease infinite;
    }

    .upload-icon-label {
        top: 0% !important;
        transform: translateY(-40%) !important;
        width: 60px !important;
        height: 40px !important;
    }
    .upload-icon-box {
        width: 60px !important;
        height: 40px !important;
    }

    .prompt-send-container {
        margin-bottom: 15px !important;
    }
}

  #settings-size-container {
    width: 100%;
    max-width: 250px;
    margin: 10px auto;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    position: relative; 
  }

  #size-select-box {
    display: inline-flex;
    min-width: 140px;
    padding: 8px 12px;
    background: #305cbb;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 14px;
    color: white;
    box-shadow: 0 0 8px rgba(74,144,226,0.8);
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    outline: none;
  }

  #size-select-box:hover,
  #size-select-box:focus {
    background-color: #4a70f0;
  }

  #size-select-box span:last-child {
    margin-left: 12px;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
  }

#size-options {
  position: absolute;
  top: 100%;
  left: 8px;
  width: 160px;
  background-color: rgba(10, 23, 64, 0.95);
  border: 1px solid rgba(74, 144, 226, 0.7);
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(74,144,226,0.6);
  max-height: 250px;
  overflow-y: auto;
  display: none;
  font-size: 14px;
  color: white;
  z-index: 12;
}


  #size-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.25s ease;
    gap: 8px;
    border-radius: 6px;
    padding: 10px 16px;
  }

  #size-options label:hover {
    background-color: rgba(74,144,226,0.5);
  }

  #size-options input[type="radio"] {
    accent-color: #4a90e2;
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
  }

  #size-options label[aria-selected="true"] {
    background-color: #4a90e2;
    font-weight: 700;
    box-shadow: 0 0 10px #4a90e2;
  }

  #size-options {
    scrollbar-width: thin;
    scrollbar-color: #4a90e2 transparent;
  }

  #size-options::-webkit-scrollbar {
    width: 6px;
  }

  #size-options::-webkit-scrollbar-thumb {
    background-color: #4a90e2;
    border-radius: 3px;
  }

  #size-options::-webkit-scrollbar-track {
    background: transparent;
  }



#model-dropdown-btn {
    width: 100%; 
}

.model-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%; 
  left: 0; 
  background-color: rgba(10, 23, 64, 0.95);
  border: 1px solid rgba(74, 144, 226, 0.7);
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(74,144,226,0.6); 
  min-width: 180px;
  font-size: 15px;
  color: #ffffff;
  box-sizing: border-box;
  user-select: none;
  padding: 10px 0;
  z-index: 10;
}

@media (max-width: 767px) {
.model-dropdown-menu {
  min-width: 170px;
}
}


.model-dropdown-item {
  display: block;
  padding: 8px 18px;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.model-dropdown-item:hover,
.model-dropdown-item:focus {
  background-color: rgba(74, 144, 226, 0.25);
  outline: none;
}