* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    font-weight: 300;
}

.main-content {
    padding: 30px;
}

section {
    margin-bottom: 40px;
}

h2 {
    color: #1a237e;
    margin-bottom: 20px;
    font-size: 1.5em;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.upload-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.upload-box {
    flex: 1;
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(102, 126, 234, 0.05);
}

.upload-box:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #764ba2;
    transform: translateY(-5px);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #667eea;
}

.upload-box h3 {
    color: #1a237e;
    margin-bottom: 10px;
}

.file-format {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.double-sided-option {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    display: inline-block;
}

.double-sided-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.setting {
    display: flex;
    flex-direction: column;
}

.setting label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.card-colors {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.card-colors h3 {
    margin-bottom: 15px;
    color: #333;
}

.color-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.color-option:hover {
    background: #e9ecef;
}

.color-option.active {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.color-sample {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.preview-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
}

.card-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.card-frame {
    width: 400px;
    height: 252px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    position: relative;
    overflow: hidden;
}

.card-placeholder {
    text-align: center;
    color: #666;
}

.card-dimensions {
    font-size: 0.9em;
    color: #888;
    margin-top: 10px;
}

.preview-controls {
    display: flex;
    gap: 10px;
}

.preview-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-rotate {
    background: #17a2b8;
    color: white;
}

.btn-flip {
    background: #28a745;
    color: white;
}

.btn-reset {
    background: #6c757d;
    color: white;
}

.preview-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.print-actions {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    justify-content: center;
}

.print-actions button {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-crop {
    background: #17a2b8;
    color: white;
}

.btn-download {
    background: #28a745;
    color: white;
}

.btn-print {
    background: #1a237e;
    color: white;
}

.print-actions button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.print-tips {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.print-tips h3 {
    color: #1a237e;
    margin-bottom: 10px;
}

.print-tips ul {
    list-style: none;
    padding-left: 0;
}

.print-tips li {
    padding: 5px 0;
    padding-left: 25px;
    position: relative;
}

.print-tips li:before {
    content: "💡";
    position: absolute;
    left: 0;
}

.instructions {
    background: #f0f4ff;
    padding: 40px;
    text-align: center;
}

.instructions h2 {
    border: none;
    margin-bottom: 30px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.step {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.step-number {
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-weight: bold;
    font-size: 1.2em;
}

.step h4 {
    color: #1a237e;
    margin-bottom: 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #1a237e;
    color: white;
}

.modal-header h2 {
    color: white;
    margin: 0;
    border: none;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-area {
    width: 100%;
    height: 400px;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cropImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.crop-controls {
    padding: 20px;
    background: white;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

#zoomSlider {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 5px;
    outline: none;
}

#zoomSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.control-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    background: #6c757d;
    color: white;
}

.apply-buttons {
    display: flex;
    gap: 10px;
}

.apply-buttons button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
}

.btn-apply {
    background: #28a745;
    color: white;
}

.btn-cancel {
    background: #dc3545;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .upload-container {
        flex-direction: column;
    }
    
    .card-frame {
        width: 300px;
        height: 189px;
    }
    
    .print-actions {
        flex-direction: column;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
}