:root {
    --primary-color: #6a0572;
    --secondary-color: #ab34ad;
    --accent-color: #ffb84d;
    --background-dark: #222831;
    --background-light: #eeeeee;
    --text-light: #fefefe;
    --text-dark: #333;
    --border-color: #555;
    --glow-color: #7B00FF;
    --success-color: #00ff88;
    --error-color: #ff3232;
    --warning-color: #ffa500;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-dark);
    color: var(--text-light);
    text-align: center;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    background: var(--background-dark);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    flex-grow: 1;
}

/* Typography */
h1 {
    color: var(--accent-color);
    font-size: 2.8em;
    margin-bottom: 0.4em;
    font-family: 'Chakra Petch', sans-serif;
    text-shadow: 0 0 8px var(--glow-color), 0 0 15px rgba(123, 0, 255, 0.4);
    letter-spacing: 1px;
}

h2 {
    color: var(--secondary-color);
    font-size: 2em;
    margin-top: 2em;
    margin-bottom: 1em;
    font-family: 'Chakra Petch', sans-serif;
    text-shadow: 0 0 5px rgba(171, 52, 173, 0.3);
}

h3 {
    color: var(--accent-color);
    font-size: 1.4em;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-family: 'Chakra Petch', sans-serif;
}

p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15em;
    color: var(--text-light);
    margin-bottom: 1.5em;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Input Section */
.input-section {
    background-color: #333941;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px dashed var(--secondary-color);
}

/* Drag & Drop Zone */
.drop-zone {
    border: 3px dashed var(--secondary-color);
    border-radius: 12px;
    padding: 40px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(106, 5, 114, 0.1) 0%, rgba(171, 52, 173, 0.1) 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone.drag-over {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(255, 184, 77, 0.2) 0%, rgba(171, 52, 173, 0.2) 100%);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 184, 77, 0.3);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-zone-icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.drop-zone-text {
    font-size: 1.2em;
    color: var(--text-light);
    margin-bottom: 10px;
}

.drop-zone-subtext {
    font-size: 0.9em;
    color: #999;
}

#fileInput {
    display: none;
}

.custom-file-upload {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.custom-file-upload:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* URL Import */
.url-import-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.url-import-wrapper {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    align-items: center;
}

#urlInput {
    flex: 1;
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background-color: #2a2e37;
    color: var(--text-light);
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s ease;
}

#urlInput:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(171, 52, 173, 0.3);
}

#urlInput::placeholder {
    color: #777;
}

#importUrlBtn {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}

#importUrlBtn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Image Previews */
#imagePreviews {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.image-preview-item {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: #444;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

.image-preview-item:hover {
    transform: scale(1.05);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(255, 50, 50, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

.remove-image:hover {
    background-color: #ff0000;
    transform: scale(1.15);
}

/* Advanced Controls Panel */
.advanced-controls {
    background-color: #2a2e37;
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
    border: 1px solid var(--border-color);
}

.advanced-controls h3 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.control-group {
    background-color: #333941;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 10px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(255, 184, 77, 0.5);
    transition: transform 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(255, 184, 77, 0.5);
    transition: transform 0.2s ease;
    border: none;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.range-value {
    display: block;
    text-align: center;
    color: var(--text-light);
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.control-group select,
.control-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background-color: #1a1a1a;
    color: var(--text-light);
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s ease;
}

.control-group select:focus,
.control-group input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 8px rgba(171, 52, 173, 0.3);
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.toggle-label {
    font-size: 0.9em;
    color: var(--text-light);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: 0.4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(30px);
}

/* Presets */
.presets-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}

.preset-btn {
    padding: 8px 16px;
    background-color: #444;
    border: 2px solid var(--border-color);
    color: var(--text-light);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.preset-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--background-dark);
}

/* Controls */
.controls {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.controls button {
    background-color: var(--accent-color);
    color: var(--background-dark);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.controls button:hover {
    background-color: #ffda8e;
    transform: translateY(-2px);
}

.controls button:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
    display: none;
    border: 1px solid var(--border-color);
}

.progress-container.active {
    display: block;
}

.progress-bar {
    height: 30px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9em;
}

/* Output Section */
.output-section {
    margin-top: 40px;
    background-color: #1a1a1a;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
    overflow: hidden;
}

.output-item {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #2a2e37;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.output-item:last-child {
    margin-bottom: 0;
}

.output-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.output-item h3 {
    color: var(--accent-color);
    margin: 0;
    font-size: 1.3em;
    font-family: 'Chakra Petch', sans-serif;
    text-shadow: 0 0 5px rgba(255, 184, 77, 0.5);
}

.output-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.output-actions button {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.output-actions button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.output-item pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    background-color: #0d0d0d;
    color: #00ff00;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 0.8em;
    line-height: 1.1;
    max-height: 60vh;
    height: auto;
    resize: vertical;
    box-shadow: inset 0 0 8px rgba(0, 255, 0, 0.2);
    border: 1px solid #005500;
    margin: 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    background-color: var(--background-dark);
    color: var(--text-light);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border-left: 4px solid var(--accent-color);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    position: relative;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.95em;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2em;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Content Sections */
.content-section {
    background-color: #2a2e37;
    padding: 30px;
    border-radius: 10px;
    margin: 30px 0;
    border: 1px solid var(--border-color);
    text-align: left;
}

.content-section h2 {
    margin-top: 0;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-item {
    background-color: #333941;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 184, 77, 0.2);
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.feature-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.feature-item p {
    margin: 0;
    font-size: 0.95em;
    color: #ccc;
}

/* Steps Section */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.step-item {
    background-color: #333941;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    text-align: center;
    position: relative;
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: var(--background-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3em;
    box-shadow: 0 0 10px rgba(255, 184, 77, 0.5);
}

.step-item h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.step-item p {
    margin: 0;
    font-size: 0.9em;
    color: #ccc;
}

/* FAQ Section */
.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background-color: #333941;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background-color: transparent;
    border: none;
    color: var(--text-light);
    padding: 20px;
    text-align: left;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: rgba(171, 52, 173, 0.1);
}

.faq-toggle {
    font-size: 1.5em;
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 20px 20px 20px;
}

.faq-answer p {
    margin: 0;
    color: #ccc;
    font-size: 1em;
    line-height: 1.6;
}

/* Footer */
footer {
    background-color: #1a1a1a;
    padding: 20px;
    text-align: center;
    color: #999;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

footer p {
    margin: 5px 0;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.6em;
    }

    h3 {
        font-size: 1.2em;
    }

    p {
        font-size: 1em;
    }

    .container {
        margin: 20px auto;
        padding: 15px;
    }

    .drop-zone {
        padding: 30px 15px;
    }

    .drop-zone-icon {
        font-size: 2em;
    }

    .drop-zone-text {
        font-size: 1em;
    }

    .custom-file-upload {
        padding: 12px 20px;
        font-size: 1em;
    }

    .url-import-wrapper {
        flex-direction: column;
    }

    #importUrlBtn {
        width: 100%;
    }

    .image-preview-item {
        width: 100px;
        height: 100px;
    }

    .remove-image {
        width: 25px;
        height: 25px;
        font-size: 0.9em;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .controls button {
        padding: 12px 24px;
        font-size: 1em;
    }

    .output-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .output-actions {
        width: 100%;
    }

    .output-actions button {
        flex: 1;
    }

    .output-item pre {
        font-size: 0.7em;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps-container {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .content-section {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.3em;
    }

    p {
        font-size: 0.9em;
    }

    .custom-file-upload {
        width: 100%;
        box-sizing: border-box;
    }

    .image-preview-item {
        width: 80px;
        height: 80px;
    }

    .controls {
        flex-direction: column;
        gap: 10px;
    }

    .controls button {
        width: 100%;
    }

    .output-item pre {
        max-height: 40vh;
        font-size: 0.65em;
    }

    .preset-btn {
        font-size: 0.8em;
        padding: 6px 12px;
    }

    .output-actions button {
        font-size: 0.85em;
        padding: 6px 12px;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Hidden utility class */
.hidden {
    display: none !important;
}