* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e0e0e0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: #FFB347;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 165, 0, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    align-items: start;
}

.controls-panel {
    background: #2c2c2c;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(255, 165, 0, 0.2), 0 0 40px rgba(255, 165, 0, 0.1);
    border: 1px solid #3a3a3a;
}

.control-section {
    margin-bottom: 20px;
}

.control-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #FFB347;
    font-size: 0.95rem;
}

.control-section input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #1a1a1a;
    color: #e0e0e0;
}

.control-section input[type="text"]:focus {
    outline: none;
    border-color: #FFB347;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

.control-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
    resize: vertical;
    min-height: 60px;
    background: #1a1a1a;
    color: #e0e0e0;
}

.control-section textarea:focus {
    outline: none;
    border-color: #FFB347;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

.text-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.text-input-header label {
    margin-bottom: 0;
}

.align-select {
    width: auto;
    padding: 6px 10px;
    border: 2px solid #3a3a3a;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #1a1a1a;
    color: #e0e0e0;
    cursor: pointer;
    transition: border-color 0.3s;
}

.align-select:focus {
    outline: none;
    border-color: #FFB347;
}

.control-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    font-size: 1rem;
    background: #1a1a1a;
    color: #e0e0e0;
    cursor: pointer;
    transition: border-color 0.3s;
}

.control-section select:focus {
    outline: none;
    border-color: #FFB347;
}

.control-section input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #3a3a3a;
    outline: none;
    -webkit-appearance: none;
}

.control-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB347 0%, #FFA500 100%);
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.control-section input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.control-section input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB347 0%, #FFA500 100%);
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.control-section input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.control-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.font-list {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    margin-top: 8px;
    background: #1a1a1a;
    display: none;
}

.font-list.active {
    display: block;
}

.font-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #3a3a3a;
    color: #e0e0e0;
}

.font-item:last-child {
    border-bottom: none;
}

.font-item:hover {
    background: #3a3a3a;
}

.font-item.selected {
    background: linear-gradient(135deg, #FFB347 0%, #FFA500 100%);
    color: #000;
    font-weight: 600;
}

.selected-font {
    margin-top: 8px;
    padding: 8px 12px;
    background: #1a1a1a;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #999;
    border: 1px solid #3a3a3a;
}

.selected-font span {
    font-weight: 600;
    color: #FFB347;
}

.font-list::-webkit-scrollbar {
    width: 8px;
}

.font-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.font-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #FFB347 0%, #FFA500 100%);
    border-radius: 8px;
}

.font-list::-webkit-scrollbar-thumb:hover {
    background: #FFA500;
}

.export-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #FFB347 0%, #FFA500 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 165, 0, 0.6), 0 0 30px rgba(255, 165, 0, 0.3);
}

.export-btn:active {
    transform: translateY(0);
}

.info-box {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #FFB347;
    border: 1px solid #3a3a3a;
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #FFB347;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 5px 0;
    font-size: 0.9rem;
    color: #999;
}

.info-box li:before {
    content: "→ ";
    color: #FFB347;
    font-weight: bold;
    margin-right: 5px;
}

.preview-panel {
    background: #2c2c2c;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(255, 165, 0, 0.2), 0 0 40px rgba(255, 165, 0, 0.1);
    min-height: 600px;
    display: flex;
    flex-direction: column;
    border: 1px solid #3a3a3a;
}

#textCanvas {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    background: #1a1a1a;
    border: 2px solid #3a3a3a;
}

.preview-info {
    text-align: left;
    margin-top: 10px;
    color: #b0b0b0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.view-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.view-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #FFB347 0%, #FFA500 100%);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.view-btn:hover {
    background: #FFA500;
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.5);
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        order: 2;
    }
    
    .preview-panel {
        order: 1;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .controls-panel {
        padding: 20px;
    }
}
