* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.upload-section {
    padding: 40px;
}

.file-drop-zone {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.05);
}

.upload-icon {
    width: 60px;
    height: 60px;
    fill: #ccc;
    margin-bottom: 20px;
}

.drop-content p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.select-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.select-btn:hover {
    transform: translateY(-2px);
}

.file-list {
    padding: 0 40px;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-icon {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    fill: #e74c3c;
}

.file-details h4 {
    color: #333;
    margin-bottom: 5px;
}

.file-details p {
    color: #666;
    font-size: 0.9em;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.remove-btn:hover {
    background: #c0392b;
}

.watermark-config {
    padding: 40px;
    border-top: 1px solid #eee;
}

.watermark-config h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.5em;
}

.config-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #4facfe;
    border-bottom-color: #4facfe;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: #4facfe;
}

.form-group input[type="range"] {
    width: calc(100% - 50px);
    margin-right: 10px;
}

.form-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.position-config {
    margin-top: 30px;
}

.position-config label {
    display: block;
    margin-bottom: 15px;
    color: #333;
    font-weight: 500;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
}

.pos-btn {
    padding: 12px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.pos-btn:hover {
    border-color: #4facfe;
}

.pos-btn.active {
    background: #4facfe;
    color: white;
    border-color: #4facfe;
}

.action-buttons {
    padding: 40px;
    text-align: center;
    border-top: 1px solid #eee;
}

.preview-btn,
.process-btn {
    padding: 15px 40px;
    margin: 0 10px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-btn {
    background: #6c757d;
    color: white;
}

.preview-btn:hover:not(:disabled) {
    background: #5a6268;
}

.process-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.preview-btn:disabled,
.process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.progress-section {
    padding: 20px 40px;
    border-top: 1px solid #eee;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 1em;
}

.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

#previewCanvas {
    max-width: 100%;
    max-height: 70vh;
    border: 1px solid #ddd;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .position-grid {
        max-width: 100%;
    }
    
    .action-buttons {
        padding: 20px;
    }
    
    .preview-btn,
    .process-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
}