/* Create Panel Styles */
.main-container {
    padding: 40px;
    box-sizing: border-box;
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.settings-panel {
    flex: 1;
    min-width: 300px;
    max-width: 700px;
}

.settings-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    box-sizing: border-box;
}

/* Unified Dropdown and Header Styles */
.dropdown-header {
    font-weight: bold;
    margin-bottom: 8px;
    margin-top: 8px;
    text-align: left;
}

.custom-select {
    position: relative;
    width: 100%;
    border: 2px solid #007BFF;
    border-radius: 5px;
    background-color: #E1E8EE;
    cursor: pointer;
    margin-bottom: 12px;
    height: 50px;
    transition: all 0.2s ease;
}

.custom-select:hover {
    background-color: #D0DDEE;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.custom-select .select-selected {
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: #333;
    font-size: 16px;
    justify-content: flex-start;
    height: 100%;
    transition: all 0.2s ease;
}

/* Enhanced Dropdown Items Container */
.custom-select .select-items {
    position: absolute;
    top: 100%;
    left: -2px; /* Align with parent border */
    right: -2px;
    z-index: 99;
    border: 2px solid #007BFF;
    border-top: none;
    background: #E1E8EE;
    display: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);

    /* Custom scrollbar - Firefox */
    scrollbar-width: thin;
    scrollbar-color: #007BFF #E1E8EE;
}

/* Custom scrollbar - Webkit */
.custom-select .select-items::-webkit-scrollbar {
    width: 8px;
}

.custom-select .select-items::-webkit-scrollbar-track {
    background: #E1E8EE;
    border-bottom-right-radius: 5px;
}

.custom-select .select-items::-webkit-scrollbar-thumb {
    background-color: #007BFF;
    border-radius: 20px;
    border: 2px solid #E1E8EE;
}

.custom-select .select-items::-webkit-scrollbar-thumb:hover {
    background-color: #0056b3;
}

/* Dropdown Items */
.custom-select .select-items div {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    font-size: 16px;
    height: 50px;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
    justify-content: flex-start;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 123, 255, 0.1);
}

.custom-select .select-items div:last-child {
    border-bottom: none;
}

.custom-select .select-items div:hover {
    background-color: #D0DDEE;
}

/* Dropdown Arrow */
.dropdown-arrow {
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #007BFF;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

/* Play/Pause Button Styles */
.play-pause {
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    z-index: 2;
}

.play-pause::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #007BFF;
}

.play-pause.play::before {
    clip-path: path('M 20,12 C 20,12.5 19.8,13 19.5,13.3 L 4,21 C 3.3,21.4 2.5,21.2 2.2,20.5 C 2.1,20.3 2,20.2 2,20 L 2,4 C 2,3.2 2.6,2.6 3.4,2.6 C 3.6,2.6 3.8,2.7 4,2.8 L 19.5,10.7 C 19.8,11 20,11.5 20,12');
}

.play-pause.pause::before {
    clip-path: path('M 6,4 C 6,4 8,4 8,4 C 9,4 10,5 10,6 L 10,18 C 10,19 9,20 8,20 L 6,20 C 5,20 4,19 4,18 L 4,6 C 4,5 5,4 6,4 Z M 14,4 C 14,4 16,4 16,4 C 17,4 18,5 18,6 L 18,18 C 18,19 17,20 16,20 L 14,20 C 13,20 12,19 12,18 L 12,6 C 12,5 13,4 14,4 Z');
}

/* Slider Styles */
.slider-container {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 12px;
    border-radius: 15px;
    margin-bottom: 12px;
}

#duration {
    font-weight: bold;
    width: 30px;
    text-align: right;
    font-size: 18px;
    color: #333;
}

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: calc(100% - 120px);
    height: 6px;
    background: #e0e0e0;
    outline: none;
    border-radius: 3px;
    transition: background 0.2s ease-in-out;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    transition: all 0.2s ease-in-out;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
    box-shadow: 0 0 0 6px rgba(52, 152, 219, 0.2);
}

input[type="range"]:active::-webkit-slider-thumb {
    box-shadow: 0 0 0 8px rgba(52, 152, 219, 0.3);
}

.info-icon {
    position: relative;
    width: 24px;
    height: 24px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: help;
}

.info-icon::after {
    content: "?";
}

.tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    width: 250px;
    background-color: #333;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 10;
}

.info-icon:hover .tooltip {
    opacity: 1;
    visibility: visible;
}


/* Script Input Styles */
.text-area-container {
    position: relative;
    max-width: 100%;
    margin: 12px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 16px;
    padding-bottom: 40px; /* Increased to make room for character counter */
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    background-color: #ffffff;
    color: #2c3e50;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
    font-weight: 400;
}

textarea:hover {
    border-color: #cbd5e1;
    background-color: #fafafa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

textarea:focus {
    border-color: #007BFF;
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.1),
                0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
}

.char-count {
    position: absolute;
    bottom: 4px; /* Moved down 10px from previous 16px */
    right: 16px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

.credit-cost {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.2s ease;
}

/* Create Video Button Styles */
.create-video-button {
    background-color: #4285F4;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: block;
    margin: 12px auto 0;
}

.create-video-button:hover {
    background-color: #3367D6;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Creating Video Popup Styles */
.creating-video-popup {
    display: none;
    position: fixed;
    z-index: 1003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.creating-video-popup-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    font-size: 18px;
    color: #333;
}

/* Caption Style Modal Adjustments */
.gif-option {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: border-color 0.3s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
    background-color: #cec2e3;
    width: calc(33.333% - 40px);
    height: 135px;  /* Changed back to original height */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gif-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
    padding: 8px;  /* Changed back to original padding */
}

.gif-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gif-option.selected {
    border-color: #007BFF;
}

@media (max-width: 768px) {
    .gif-option {
        width: calc(50% - 30px);
        height: 110px;
    }
}

@media (max-width: 480px) {
    .gif-option {
        width: 100%;
        height: 135px;
    }
}

/* Special handling for voice selector alignment */
#customSelectVoice .select-selected span:nth-child(2) {
    text-align: left;
}

/* Credit Confirmation Popup Styles */
.credit-confirmation-popup {
    display: none;
    position: fixed;
    z-index: 1004;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.credit-confirmation-popup.active {
    opacity: 1;
}

.credit-confirmation-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.credit-confirmation-popup.active .credit-confirmation-content {
    transform: translateY(0);
    opacity: 1;
}

.credit-confirmation-content h3 {
    color: #2D3748;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.credit-confirmation-content p {
    color: #4A5568;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.credit-amount {
    color: #3182CE;
    font-weight: 600;
}

.button-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-button, .cancel-button {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem; /* Reduced from 1rem to 0.875rem (14px) */
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 140px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* Ensures text stays on one line */
}

.confirm-button {
    background-color: #4285F4;
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(66, 133, 244, 0.2);
}

.confirm-button:hover {
    background-color: #3367D6;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.cancel-button {
    background-color: white;
    color: #4A5568;
    border: 1px solid #E2E8F0;
}

.cancel-button:hover {
    background-color: #F7FAFC;
    border-color: #CBD5E0;
}

/* Ensure buttons maintain size on mobile */
@media (max-width: 480px) {
    .confirm-button, .cancel-button {
        width: 120px;
        font-size: 0.8125rem; /* Even slightly smaller on mobile (13px) */
    }
}

/* Pacing Selector Styles */
.pacing-selector {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    border: 2px solid #007BFF;
    border-radius: 25px; /* Makes the container oval-like */
    overflow: hidden; /* Ensures child elements don't overflow the container */
}

.pacing-option {
    flex: 1;
    padding: 10px 0;
    background-color: #E1E8EE;
    border: none;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-align: center;
    user-select: none;
    outline: none;
}

/* Remove borders between buttons */
.pacing-option:not(:first-child) {
    border-left: 1px solid #007BFF;
}

/* First and Last Pacing Option Border Radius */
.pacing-option:first-child {
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
}

.pacing-option:last-child {
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
}

/* Hover Effect */
.pacing-option:hover {
    background-color: #D0DDEE;
}

/* Selected Pacing Option */
.pacing-option.selected {
    background-color: #007BFF;
    color: white;
}

/* Create Time Estimate Styles */
.create-time-estimate {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}

