* {
    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%);
    color: #333;
    overflow: hidden;
}

.app-container {
    width: 1200px;
    height: 1024px;
    margin: 0 auto;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.app-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-icon:active {
    transform: translateY(0);
}

/* Main Content */
.app-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Control Panel */
.control-panel {
    width: 400px;
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #e0e0e0;
    overflow: hidden;
}

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    background: #f0f0f0;
    border-bottom: 2px solid #e0e0e0;
    padding: 5px;
    gap: 2px;
}

.tab-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 8px;
    background: #e0e0e0;
    border: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-btn:hover {
    background: #d0d0d0;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 2px solid white;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.tab-content.active {
    display: block;
}

.control-section {
    padding: 0;
    background: transparent;
    border: none;
    margin: 0;
}

.control-section h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

/* Remove h2 from tab content sections since tabs replace them */
.tab-content .control-section h2 {
    display: none;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.control-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    cursor: pointer;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.color-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.color-item label {
    font-size: 11px;
    color: #666;
}

.color-picker {
    width: 100%;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.color-picker:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Button Texts */
.button-texts-container {
    margin-bottom: 10px;
    padding: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.button-text-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 5px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.button-text-item input {
    flex: 1;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.button-text-item button {
    background: #ff4444;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.button-text-item button:hover {
    background: #cc0000;
}

.btn-small {
    width: 100%;
    padding: 8px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-small:hover {
    background: #5568d3;
}

/* Preview Panel */
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f0f0f0;
    overflow: hidden;
}

.preview-tabs {
    display: flex;
    background: #f0f0f0;
    border-bottom: 2px solid #e0e0e0;
    padding: 5px;
    gap: 2px;
}

.preview-tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: #e0e0e0;
    border: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.preview-tab-btn:hover {
    background: #d0d0d0;
    color: #333;
}

.preview-tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 2px solid white;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.preview-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.preview-tab-content.active {
    display: flex;
    flex-direction: column;
}

.preview-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.canvas-container {
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin-bottom: 15px;
}

.sample-label {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}

canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.preview-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.export-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.export-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.btn-primary {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    padding: 10px 20px;
    background: #999;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #777;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s;
}

.modal-small {
    width: 400px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.color-preview {
    width: 100%;
    height: 100px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-control label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.color-control input[type="range"] {
    width: 100%;
}

.color-control input[type="text"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 100px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-body input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
}

.modal-body input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

