/* Form Container */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Upload Sections */
.upload-section,
.text-section,
.style-section,
.preview-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

h2 {
    color: #2196F3;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Dropzone */
.dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #fafafa;
    position: relative;
    transition: all 0.3s ease;
    min-height: 150px;
}

.dropzone.dragover {
    border-color: #2196F3;
    background: #e3f2fd;
}

/* Progress Bar */
.progress-container {
    margin: 10px 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar > div {
    height: 100%;
    background: #2196F3;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Text Preview */
.text-preview {
    margin: 15px 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}

.text-count {
    color: #2196F3;
    font-weight: 500;
    margin-bottom: 5px;
}

.text-sample {
    color: #666;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Image Preview */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.image-preview {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.image-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #ff4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 0;
    line-height: 1;
}

.image-preview .delete-btn:hover {
    background: #ff4444;
    color: white;
}

.dropzone-content {
    margin-bottom: 15px;
}

.upload-label {
    color: #2196F3;
    cursor: pointer;
    text-decoration: underline;
}

.upload-label:hover {
    color: #1976D2;
}

.upload-info {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* File Inputs */
input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Text Area */
#textInput {
    width: 100%;
    min-height: 150px;
    margin-top: 15px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#textInput:focus {
    border-color: #2196F3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.2);
}

#textInput::placeholder {
    color: #888;
    font-style: italic;
}

/* Style Controls */
.style-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    color: #444;
}

/* Inputs and Selects */
input[type="color"],
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    width: 100%;
    padding: 8px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #2196F3;
    cursor: pointer;
    margin-top: -8px;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    border: none;
}

input[type="range"]:focus {
    outline: none;
}

select {
    height: 38px;
    cursor: pointer;
}

/* Font Family Select */
#fontFamily {
    font-size: 16px;
    height: auto;
    min-height: 300px;
    padding: 12px;
}

#fontFamily option {
    padding: 12px 8px;
    font-size: 16px;
    line-height: 1.5;
}

#fontFamily option:hover {
    background-color: #f0f0f0;
}

/* Sans-Serif Fonts */
#fontFamily option[value*="Arial"]:not([value*="Black"]):not([value*="Narrow"]) { font-family: Arial, sans-serif; }
#fontFamily option[value*="Arial Black"] { font-family: "Arial Black", sans-serif; }
#fontFamily option[value*="Arial Narrow"] { font-family: "Arial Narrow", sans-serif; }
#fontFamily option[value*="Verdana"] { font-family: Verdana, sans-serif; }
#fontFamily option[value*="Helvetica"]:not([value*="Neue"]) { font-family: Helvetica, sans-serif; }
#fontFamily option[value*="Helvetica Neue"] { font-family: "Helvetica Neue", sans-serif; }
#fontFamily option[value*="Trebuchet MS"] { font-family: "Trebuchet MS", sans-serif; }
#fontFamily option[value*="Tahoma"] { font-family: Tahoma, sans-serif; }
#fontFamily option[value*="Century Gothic"] { font-family: "Century Gothic", sans-serif; }
#fontFamily option[value*="Franklin Gothic"] { font-family: "Franklin Gothic Medium", sans-serif; }
#fontFamily option[value*="Impact"] { font-family: Impact, sans-serif; }
#fontFamily option[value*="Segoe UI"] { font-family: "Segoe UI", sans-serif; }
#fontFamily option[value*="Open Sans"] { font-family: "Open Sans", sans-serif; }
#fontFamily option[value*="Roboto"] { font-family: Roboto, sans-serif; }
#fontFamily option[value*="Noto Sans"] { font-family: "Noto Sans", sans-serif; }

/* Serif Fonts */
#fontFamily option[value*="Times New Roman"] { font-family: "Times New Roman", serif; }
#fontFamily option[value*="Georgia"] { font-family: Georgia, serif; }
#fontFamily option[value*="Garamond"] { font-family: Garamond, serif; }
#fontFamily option[value*="Palatino"] { font-family: "Palatino Linotype", serif; }
#fontFamily option[value*="Book Antiqua"] { font-family: "Book Antiqua", serif; }
#fontFamily option[value*="Cambria"] { font-family: Cambria, serif; }
#fontFamily option[value*="Noto Serif"] { font-family: "Noto Serif", serif; }
#fontFamily option[value*="Libre Baskerville"] { font-family: "Libre Baskerville", serif; }

/* Display & Decorative */
#fontFamily option[value*="Comic Sans"] { font-family: "Comic Sans MS", cursive; }
#fontFamily option[value*="Brush Script"] { font-family: "Brush Script MT", cursive; }
#fontFamily option[value*="Segoe Script"] { font-family: "Segoe Script", cursive; }
#fontFamily option[value*="Lucida Handwriting"] { font-family: "Lucida Handwriting", cursive; }
#fontFamily option[value*="Papyrus"] { font-family: Papyrus, fantasy; }

/* Monospace */
#fontFamily option[value*="Courier New"] { font-family: "Courier New", monospace; }
#fontFamily option[value*="Lucida Console"] { font-family: "Lucida Console", monospace; }
#fontFamily option[value*="Consolas"] { font-family: Consolas, monospace; }
#fontFamily option[value*="Monaco"] { font-family: Monaco, monospace; }

/* Modern Sans */
#fontFamily option[value*="Ubuntu"] { font-family: Ubuntu, sans-serif; }
#fontFamily option[value*="Source Sans Pro"] { font-family: "Source Sans Pro", sans-serif; }
#fontFamily option[value*="Montserrat"] { font-family: "Montserrat", sans-serif; }
#fontFamily option[value*="Raleway"] { font-family: "Raleway", sans-serif; }
#fontFamily option[value*="Lato"] { font-family: "Lato", sans-serif; }

select:focus,
input:focus {
    border-color: #2196F3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.2);
}

/* Preview Container */
.preview-container {
    margin-top: 20px;
    min-height: 50px;
}

/* Error States */
.dropzone.error {
    border-color: #ff4444;
    background-color: #ffebee;
}

.error-message {
    color: #ff4444;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Loading States */
.dropzone.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Download All Button */
#downloadAllContainer {
    text-align: center;
    margin: 20px 0;
}

#generateBtn {
    margin-top: 20px;
}

.download-all-btn {
    padding: 15px 30px;
    font-size: 18px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.download-all-btn:hover {
    background-color: #218838;
}

.download-all-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .style-controls {
        grid-template-columns: 1fr;
    }

    .control-group {
        margin-bottom: 20px;
    }

    .download-all-btn {
        width: 100%;
        padding: 12px 20px;
    }
}
