* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 300;
}

header h1 i {
    margin-right: 15px;
    color: #fff;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Main Layout - Two Columns */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 70vh;
}

/* Left Column - Preview */
.preview-column {
    padding: 30px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 500;
}

.preview-section h3 i {
    margin-right: 10px;
}

.preview-container {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    min-height: 300px;
}

#preview-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.preview-placeholder {
    text-align: center;
    color: #999;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Action Buttons */
.action-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* Right Column - Controls */
.controls-column {
    padding: 30px;
    background: white;
    overflow-y: visible;
    max-height: none;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.upload-group {
    display: flex;
    flex-direction: column;
}

.upload-group label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
    font-size: 1rem;
}

.upload-group label i {
    margin-right: 8px;
    color: #667eea;
}

input[type="file"] {
    padding: 12px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #764ba2;
    background: #f8f9fa;
}

.file-info {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Thumbnails Section */
.thumbnails-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.thumbnails-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.thumbnails-section h4 i {
    margin-right: 8px;
    font-size: 0.9rem;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.thumbnail-item {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
}

.thumbnail-item:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail-item:hover .remove-btn {
    opacity: 1;
}

.thumbnail-item .remove-btn:hover {
    background: #c82333;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.settings-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 500;
}

.settings-section h3 i {
    margin-right: 8px;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.setting-group label small {
    color: #999;
    font-weight: normal;
    font-style: italic;
}

/* Effects Grid */
.effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.effect-group {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.effect-group h5 {
    color: #764ba2;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 6px;
}

.effect-group h5 i {
    margin-right: 6px;
    font-size: 0.8rem;
}

.effect-group .setting-row {
    margin-bottom: 10px;
}

.effect-group .setting-group {
    margin-bottom: 8px;
}

.effect-group .setting-group label {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

/* Text Sections */
.text-section {
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.text-section h4 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.text-section h4 i {
    margin-right: 6px;
}

/* Text Effects */
.text-effects {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.text-effects h5 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.text-effects h5 i {
    margin-right: 6px;
    font-size: 0.9rem;
}

/* Color Controls */
.color-picker-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="color"] {
    width: 50px;
    height: 35px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

input[type="text"] {
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    font-family: monospace;
    flex: 1;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    resize: vertical;
    min-height: 60px;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea::placeholder {
    color: #999;
}

/* Range Sliders */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #764ba2;
    transform: scale(1.1);
}

select {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

/* Font size value displays */
span[id$="-value"] {
    font-weight: 600;
    color: #667eea;
    font-size: 0.85rem;
    margin-left: 8px;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

/* Progress Section */
.progress-section {
    margin: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.progress-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 500;
}

.progress-section h3 i {
    margin-right: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
}

.log-container {
    background: #2d3748;
    border-radius: 8px;
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.log-output {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.4;
}

.log-success {
    color: #68d391;
}

.log-error {
    color: #fc8181;
}

.log-info {
    color: #63b3ed;
}

/* Results Section */
.results-section {
    margin: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.results-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 500;
}

.results-section h3 i {
    margin-right: 10px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.result-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: translateY(-3px);
}

.result-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.result-item h4 {
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.result-item .file-size {
    color: #666;
    font-size: 0.8rem;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #dee2e6;
    color: #666;
}

footer i {
    color: #28a745;
    margin-right: 5px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .preview-column {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .controls-column {
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .preview-column, .controls-column {
        padding: 20px;
    }
    
    .setting-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .color-picker-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .color-picker-group input[type="color"] {
        width: 100%;
        height: 40px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .action-section .btn {
        margin-bottom: 10px;
    }
    
    .effects-grid {
        grid-template-columns: 1fr;
    }
    
    .effect-group {
        margin-bottom: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 