/* Layout & Container */
.video-gen-section {
    padding: 100px 0 60px;
    min-height: 100vh;
    color: #fff;
}

.video-gen-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 16px;
    background: #fff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-title {
    text-align: center;
    color: #fff;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Input Area */
.input-area-wrapper {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.input-top-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.reference-image-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
    color: #fff;
}

.reference-image-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.reference-image-btn .icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    opacity: 0.7;
}

.text-input-container {
    flex: 1;
}

.text-input-container textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    min-height: 80px;
    font-family: inherit;
}

.text-input-container textarea::placeholder {
    color: #f4f5ebde;
}

.char-count {
    text-align: right;
    font-size: 15px;
    color: #fff;
    float: left;
    margin-right: 20px;
    margin-top: 12%;
}

/* Toolbar */
.input-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.toolbar-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #000;
    border: 1px solid transparent;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tool-btn .icon {
    font-size: 16px;
}

.generate-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5c9dff, #7b4dff);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    transition: all 0.3s;
    opacity: 0.5;
}

.generate-btn.active {
    cursor: pointer;
    opacity: 1;
}

.generate-btn:hover.active {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.generate-btn img {
    width: 24px;
    height: 24px;
}

/* Dropdown Menus */
.tool-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    background: #1F1F1F;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.dropdown-menu.show {
    display: block;
}

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

.dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    background: #000;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.dropdown-item.active {
    background: #11f;
    color: #fff;
}

.dropdown-item .icon {
    font-size: 20px;
    margin-top: 2px;
}

.item-content {
    flex: 1;
}

.item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.item-desc {
    font-size: 12px;
    color: #fff;
    line-height: 1.4;
}

.tool-btn.active-dropdown {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Generation Results */
.generation-results {
    width: 100%;
    margin-top: 40px;
    display: grid;
    gap: 20px;
    /* Default grid for 1 item, will be updated by JS */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.result-card {
    position: relative;
    background-color: #1F1F1F;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    aspect-ratio: 9/16; /* Default ratio */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-card.ratio-16-9 {
    aspect-ratio: 16/9;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.result-card:hover .play-icon-overlay {
    opacity: 1;
}

.play-icon-overlay svg {
    width: 48px;
    height: 48px;
    fill: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #1F1F1F 25%, #2A2A2A 50%, #1F1F1F 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
    width: 100%;
    height: 100%;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-text {
    position: absolute;
    bottom: 50%;
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    font-size: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.close-modal {
    position: absolute;
    top: -50px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
}

.close-modal:hover {
    color: #bbb;
    transform: rotate(90deg);
}
