/* Container */
.create-novel-container {
    min-height: 100vh;
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
}

/* Form */
.create-novel-form {
    display: flex;
    justify-content: space-between;
    background-color: var(--body-bg-color);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
    gap: 1rem;
    max-width: 1200px;
    width: 100%;
    color: var(--text-color);
}

/* Left Section - Cover Upload */
.create-novel-left-section {
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.novel-cover-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 16px;
    padding: 1.5rem 1.5rem 0;
    max-width: 300px;
    background-color: var(--sidebar-secondary-bg-color);
    aspect-ratio: 9/16;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.cover-image-container {
    width: 100%;
    height: 80%;
    background-color: var(--input-bg-color);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 1rem;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cover-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--select-gradient);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease-in-out;
    text-wrap: nowrap;
    cursor: pointer;
    border: 1px solid rgba(255, 166, 23, 0.2);
}

.cover-upload-label:hover {
    background: var(--select-hover-gradient);
}

.upload-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

input[type="file"] {
    display: none;
}

.cover-size-hint {
    color: var(--text-muted-color);
    margin-top: 0.5rem;
}

/* Right Section - Form Details */
.create-novel-right-section {
    width: 60%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.create-novel-title {
    font-size: 1.75rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
}

.form-section-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

/* Form Controls */
.create-novel-form input[type="text"], 
.create-novel-form input[type="number"],
.create-novel-form textarea, 
.create-novel-form .form-control,
.create-novel-form .fandom-option select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--input-border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--input-bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.create-novel-form input[type="text"]:focus, 
.create-novel-form input[type="number"]:focus,
.create-novel-form textarea:focus, 
.create-novel-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 166, 23, 0.2);
}

.create-novel-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Story Origin */
#id_story_origin {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.story-origin-label {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--input-border-color);
    border-radius: 5px;
    background-color: var(--input-bg-color);
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color) !important;
    margin: 0;
    transition: all 0.3s ease;
}

.story-origin-label:hover {
    background-color: var(--checkbox-hover-bg);
}

.story-origin-label input {
    display: none;
}

.story-origin-label.selected {
    background-color: var(--primary-color);
    color: var(--about-button-text-color) !important;
    border-color: var(--primary-color);
}

/* Translation Toggle - Modern Switch */
.translation-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.translation-toggle-wrapper {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.translation-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.translation-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    border: 1px solid #555;
    transition: all 0.3s ease;
    border-radius: 24px;
}

.translation-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #666;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.translation-toggle-input:checked + .translation-toggle-slider {
    background-color: #ff8c00;
    border-color: #ff8c00;
}

.translation-toggle-input:checked + .translation-toggle-slider:before {
    transform: translateX(26px);
    background-color: #fff;
}

.translation-toggle-label {
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.translation-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--sidebar-secondary-bg-color);
    border-radius: 8px;
    border: 1px solid var(--input-border-color);
}

.translation-fields .form-group {
    margin-bottom: 0;
}

.translation-fields label {
    font-size: 0.9rem;
    color: var(--text-muted-color);
}

/* Choice Elements */
.choice-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.choice-button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--input-border-color);
    border-radius: 25px;
    background-color: var(--input-bg-color);
    color: var(--text-color);
    margin: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.choice-button:hover {
    background-color: var(--cancel-btn-bg);
}

.choice-button.selected {
    background-color: var(--primary-color);
    color: var(--about-button-text-color);
    border-color: var(--primary-color);
}

/* Tag System */
.tag-input-container {
    position: relative;
}

.tag-dropdown {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--input-bg-color);
    border: 1px solid var(--input-border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 1000;
    overscroll-behavior: contain;
    display: none;
}

.tag-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--text-color);
}

.tag-option:hover {
    background-color: var(--cancel-btn-bg);
}

.selected-tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--about-button-text-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.selected-tag:hover {
    background-color: var(--primary-hover-color);
}

.remove-tag {
    cursor: pointer;
    margin-left: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
}

.tag-dropdown::-webkit-scrollbar {
    width: 8px;
}

.tag-dropdown::-webkit-scrollbar-track {
    background: var(--scrollbar-track-bg);
    border-radius: 10px;
}

.tag-dropdown::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-bg);
    border-radius: 10px;
    border: 2px solid var(--scrollbar-track-bg);
}

.tag-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-bg);
}

/* Form Actions */
.create-novel-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.create-novel-form-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cancel-btn, .skip-btn {
    background-color: var(--cancel-btn-bg);
    color: var(--secondary-color);
}

.cancel-btn:hover, .skip-btn:hover {
    background-color: var(--pagination-hover-bg);
}

.next-btn {
    background-color: var(--primary-color);
    color: var(--about-button-text-color);
}

.next-btn:hover {
    background-color: var(--primary-hover-color);
}

/* Status Toggle */
.status-toggle {
    position: relative;
    display: inline-block;
    width: 160px;
    height: 34px;
}

.status-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.status-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    transition: .4s;
    border-radius: 34px;
}

.status-label:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 0;
    background-color: var(--text-dark-light-color);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .status-label {
    background-color: var(--error-color);
}

input:checked + .status-label:before {
    transform: translateX(126px);
}

.status-text {
    color: var(--text-dark-light-color);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: bold;
}

.status-text.ongoing {
    left: 35px;
}

.status-text.completed {
    right: 35px;
    opacity: 0;
}

input:checked + .status-label .status-text.ongoing {
    opacity: 0;
}

input:checked + .status-label .status-text.completed {
    opacity: 1;
}

/* Responsive Design */
@media screen and (max-width: 1500px) {
    .create-novel-container {
        width: calc(100% - 4.4em);
        margin-left: 4.4em;
    }
}

@media screen and (max-width: 1024px) {
    .create-novel-container {
        margin: 0;
        width: 100%;
    }
    
    .create-novel-form {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .create-novel-left-section, 
    .create-novel-right-section {
        width: 100%;
    }
    
    .novel-cover-upload {
        max-width: 210px;
        height: 350px;
        background: none;
    }
    
    .create-novel-title {
        font-size: 1.5rem;
    }
    
    .choice-button {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    
    .tag-input-container {
        margin-bottom: 1rem;
    }
    
    .selected-tags {
        margin-top: 0.75rem;
    }
    
    .translation-fields {
        padding: 0.75rem;
    }
}

@media screen and (max-width: 769px) {
    .create-novel-form {
        padding: 1rem;
    }
    
    .create-novel-title {
        font-size: 1.35rem;
    }
    
    .form-group {
        font-size: 0.6rem;
    }
    
    .upload-icon {
        font-size: 1rem;
    }
    
    .choice-button {
        padding: 0.4rem 0.8rem;
        font-size: 1rem;
    }
    
    .selected-tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .tag-option {
        font-size: 0.8rem;
    }
    
    .create-novel-form-actions {
        gap: 0.75rem;
    }
    
    .create-novel-form-actions button {
        width: 100%;
        padding: 0.7rem 1rem;
    }
    
    .chapter-creator-scroll-controls {
        right: 15px;
        bottom: 60px;
    }
    
    .chapter-creator-scroll-btn {
        width: 40px;
        height: 40px;
    }
    
    .translation-fields {
        padding: 0.5rem;
    }
    
    .translation-checkbox-label {
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 400px) {
    .create-novel-container {
        padding: 0;
    }
    
    .create-novel-title {
        font-size: 1.25rem;
    }

    .choice-button {
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
    }
    
    .selected-tag {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }
    
    .create-novel-form-actions button {
        padding: 0.6rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .translation-checkbox-label {
        font-size: 0.85rem;
    }
}