* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.input-section, .preview-section, .code-section {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #2a2a2a;
}

h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #ffffff;
}

h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #e0e0e0;
}

#text-input {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #ffffff;
    resize: vertical;
    margin-bottom: 30px;
    font-family: inherit;
}

#text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.gradient-controls {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-group label {
    width: 150px;
    font-weight: 500;
    color: #b0b0b0;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #2a2a2a;
}

input[type="text"] {
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #ffffff;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.95em;
    width: 100px;
}

.toggle-btn {
    padding: 8px 16px;
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: #667eea;
    border-color: #667eea;
}

select {
    padding: 10px 15px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #ffffff;
    font-size: 1em;
    cursor: pointer;
    flex: 1;
}

input[type="range"] {
    flex: 1;
    height: 6px;
    background: #3a3a3a;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #764ba2;
}

#font-size-value {
    min-width: 60px;
    text-align: right;
    color: #b0b0b0;
}

.preset-section {
    margin-top: 30px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.preset-btn {
    padding: 12px 20px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.preset-btn:hover {
    background: #3a3a3a;
    transform: translateY(-2px);
}

.preview-container {
    background: #2a2a2a;
    padding: 60px 30px;
    border-radius: 12px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3a3a3a;
}

.gradient-text {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(to right, #ff0080 0%, #7928ca 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    line-height: 1.2;
}

.code-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px 8px 0 0;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #3a3a3a;
    border-bottom-color: #3a3a3a;
}

.code-container {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 0 8px 8px 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

#code-output {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copy-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.icon {
    font-size: 1.2em;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .input-section, .preview-section, .code-section {
        padding: 20px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-group label {
        width: 100%;
    }
    
    .preset-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .gradient-text {
        font-size: 36px;
    }
}