* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f23;
    min-height: 100vh;
    color: #fff;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #1a1a2e;
    border-right: 1px solid #2a2a3e;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid #2a2a3e;
}

.sidebar-header h1 {
    color: #fff;
    font-size: 1.8em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: #aaa;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #2a2a3e;
    color: #fff;
}

.nav-item.active {
    background: #2a2a3e;
    color: #fff;
    border-left-color: #667eea;
}

.nav-item .icon {
    font-size: 1.3em;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.section {
    display: none;
    max-width: 800px;
    margin: 0 auto;
}

.section.active {
    display: block;
}

h2 {
    color: #fff;
    font-size: 2em;
    margin-bottom: 30px;
}

/* Home Section */
.home-container {
    text-align: center;
    padding: 40px 20px;
}

.welcome-title {
    font-size: 3em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-weight: bold;
}

.welcome-subtitle {
    font-size: 1.3em;
    color: #aaa;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
}

.feature-card {
    background: #1a1a2e;
    border: 2px solid #2a2a3e;
    border-radius: 15px;
    padding: 30px 20px;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.feature-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.feature-card p {
    color: #aaa;
    font-size: 0.9em;
    line-height: 1.5;
}

.input-section,
.output-section {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-weight: 600;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #2a2a3e;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
    background: #1a1a2e;
    color: #fff;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

#tinyText,
#gradientOutput {
    background-color: #0f0f23;
    font-size: 18px;
    line-height: 1.6;
}

.copy-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.color-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.color-controls-header label {
    margin: 0;
    font-size: 1.1em;
}

.color-buttons {
    display: flex;
    gap: 10px;
}

.small-btn {
    padding: 8px 16px;
    background: #2a2a3e;
    color: #fff;
    border: 2px solid #3a3a4e;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.small-btn:hover {
    background: #3a3a4e;
    border-color: #667eea;
}

#colorStops {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-stop {
    background: #1a1a2e;
    border: 2px solid #2a2a3e;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.color-stop-number {
    font-weight: bold;
    color: #667eea;
    min-width: 70px;
}

.color-stop-picker {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-stop-picker input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #2a2a3e;
    border-radius: 8px;
    cursor: pointer;
    background: #0f0f23;
}

.color-stop-picker input[type="text"] {
    width: 100px;
    padding: 8px;
    border: 2px solid #2a2a3e;
    border-radius: 8px;
    font-family: monospace;
    text-align: center;
    background: #0f0f23;
    color: #fff;
    font-size: 14px;
}

.color-stop-position {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-stop-position label {
    margin: 0;
    min-width: 70px;
    font-size: 0.9em;
}

.color-stop-position input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #2a2a3e;
    outline: none;
    -webkit-appearance: none;
}

.color-stop-position input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.color-stop-position input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.color-stop-position input[type="number"] {
    width: 60px;
    padding: 8px;
    border: 2px solid #2a2a3e;
    border-radius: 8px;
    background: #0f0f23;
    color: #fff;
    text-align: center;
    font-size: 14px;
}

.color-picker-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-group input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #2a2a3e;
    border-radius: 10px;
    cursor: pointer;
    background: #1a1a2e;
}

.color-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #2a2a3e;
    border-radius: 10px;
    font-size: 14px;
    font-family: monospace;
    text-align: center;
    background: #1a1a2e;
    color: #fff;
}

.format-controls {
    margin-bottom: 20px;
}

.format-controls select {
    width: 100%;
    padding: 12px;
    border: 2px solid #2a2a3e;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    background: #1a1a2e;
    color: #fff;
}

.formatting-controls {
    margin-bottom: 20px;
}

.formatting-controls label {
    margin-bottom: 12px;
}

.formatting-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.format-btn {
    width: 50px;
    height: 50px;
    background: #1a1a2e;
    border: 2px solid #2a2a3e;
    border-radius: 10px;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-btn:hover {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

.format-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.preview {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 20px;
    background: #0f0f23;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #2a2a3e;
}

/* Color Codes Grid */
.color-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.color-code-item {
    background: #1a1a2e;
    border: 2px solid #2a2a3e;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-code-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.color-code-item .code {
    font-size: 1.3em;
    font-weight: bold;
    font-family: monospace;
}

.color-code-item .color-name {
    font-size: 0.9em;
    color: #aaa;
}

.color-code-item .hex-code {
    font-size: 0.85em;
    font-family: monospace;
    color: #888;
}

/* Coordinates Converter */
.coordinates-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 880px;
    margin: 0 auto;
}

.coord-section {
    background: #1a1a2e;
    border: 2px solid #2a2a3e;
    border-radius: 15px;
    padding: 30px 40px;
}

.coord-section h3 {
    color: #fff;
    font-size: 1.6em;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

.coord-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 25px;
    max-width: 100%;
}

.coord-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coord-input-group label {
    font-size: 0.95em;
    color: #aaa;
    text-align: center;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.coord-input-group input[type="number"] {
    padding: 18px 12px;
    border: 2px solid #2a2a3e;
    border-radius: 10px;
    font-size: 20px;
    background: #0f0f23;
    color: #fff;
    text-align: center;
    font-weight: 700;
    transition: all 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.coord-input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
