* {
    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: 1800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
}

/* Controls Panel */
.controls-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.section-title {
    font-size: 1.1em;
    color: #495057;
    margin: 15px 0 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #6c5ce7;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #6c5ce7;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 4px;
    color: #495057;
    font-weight: 500;
    font-size: 0.85em;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.input-group textarea {
    min-height: 50px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-group input[type="range"] {
    flex: 1;
}

.range-group span {
    min-width: 45px;
    text-align: right;
    font-size: 12px;
}

.color-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.color-option {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.color-option.active {
    border-color: #333;
    transform: scale(1.1);
}

.color-option.black {
    background: #000;
}

.color-option.blue {
    background: #2b6c9e;
}

.color-option.red {
    background: #c41e3a;
}

.color-option.green {
    background: #2e7d32;
}

.color-option.purple {
    background: #6a1b9a;
}

.color-option.orange {
    background: #e65100;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #6c5ce7;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background: #f0f0ff;
    cursor: pointer;
    margin-bottom: 15px;
}

.upload-area:hover {
    background: #e8e8ff;
}

.upload-area i {
    font-size: 30px;
    color: #6c5ce7;
    margin-bottom: 5px;
}

.sign-preview {
    max-width: 100px;
    max-height: 50px;
    margin-top: 10px;
    display: none;
}

/* Accordion */
.accordion-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-header {
    background: #e9ecef;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9em;
}

.accordion-header:hover {
    background: #dee2e6;
}

.accordion-content {
    padding: 15px;
    display: none;
    border-top: 1px solid #dee2e6;
}

.accordion-item.active .accordion-content {
    display: block;
}

/* Preview Panel */
.preview-panel {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.canvas-container {
    background: #f1f3f5;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    min-height: 500px;
    position: relative;
}

#stampCanvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    cursor: move;
}

.canvas-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* Element List */
.element-list {
    background: white;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    max-height: 250px;
    overflow-y: auto;
}

.element-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.element-item:hover {
    background: #f0f0f0;
}

.element-item.selected {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.element-item .drag-handle {
    cursor: move;
    color: #999;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: #6c5ce7;
    color: white;
}

.btn-primary:hover {
    background: #5f4fd6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 15px;
}

/* Print Layout */
.print-layout {
    margin-top: 20px;
    padding: 15px;
    background: #e9ecef;
    border-radius: 12px;
}

.print-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.print-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    min-height: 150px;
}

.print-stamp {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
}

.print-stamp canvas {
    width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        max-height: none;
        position: static;
    }
}

/* How to Use Section */
.how-to-use {
    background: linear-gradient(135deg, #f6f9fc, #e9f2f9);
    border-radius: 20px;
    padding: 40px;
    margin: 40px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.section-header p {
    color: #666;
    font-size: 1.1em;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.step-number {
    width: 50px;
    height: 50px;
    background: #6c5ce7;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    margin: 0 auto 20px;
}

.step-card i {
    font-size: 3em;
    color: #6c5ce7;
    margin-bottom: 20px;
}

.step-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.step-card p {
    color: #666;
    line-height: 1.6;
}

/* Related Tools */
.related-tools {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin: 40px 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tool-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    display: block;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
    background: linear-gradient(135deg, #6c5ce7, #a463f5);
    color: white;
}

.tool-card i {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #6c5ce7;
}

.tool-card:hover i {
    color: white;
}

.tool-card h3 {
    margin-bottom: 8px;
    font-size: 1.1em;
}

.tool-card p {
    font-size: 0.9em;
    opacity: 0.8;
}

.footer-bottom {
    max-width: 1400px;
    margin: 40px auto 0;
    padding: 20px 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    opacity: 0.6;
    font-size: 0.9em;
}