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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #e5e5e5;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 0.25rem;
    border: 1px solid #2a2a2a;
}

header h1 {
    color: #8b5cf6;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

header p {
    color: #a1a1aa;
    font-size: 1.1rem;
}

.tool-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 0.25rem;
    border: 1px solid #2a2a2a;
}

.nav-btn {
    padding: 12px 20px;
    background: #2a2a2a;
    color: #e5e5e5;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: 1px solid #3a3a3a;
}

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

.nav-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-color: #8b5cf6;
}

.tool-section {
    display: none;
    background: #1a1a1a;
    border-radius: 0.25rem;
    padding: 30px;
    border: 1px solid #2a2a2a;
}

.tool-section.active {
    display: block;
}

.tool-section h2 {
    color: #8b5cf6;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.tool-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Slider styling fix - PURPLE/VIOLET */
input[type="range"] {
    flex: 1;
    margin-right: 10px;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #3a3a3a;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #1a1a1a;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #1a1a1a;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}

input[type="range"]::-moz-range-track {
    height: 8px;
    background: #3a3a3a;
    border-radius: 4px;
}

/* Password Generator */
.generate-btn {
    font-size: 1.2rem;
    padding: 15px 30px;
    margin: 20px 0;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.option-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.option-row label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

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

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
}

.password-results {
    margin-top: 20px;
}

.password-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.password-display {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: #8b5cf6;
    background: #1a1a1a;
    padding: 12px;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
    text-align: center;
    letter-spacing: 1px;
}

.password-strength {
    padding: 8px 12px;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.strength-weak { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; }
.strength-medium { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid #f59e0b; }
.strength-strong { background: rgba(34, 197, 94, 0.2); color: #22c55e; border: 1px solid #22c55e; }

.copy-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    min-width: auto;
}

/* Color Picker */
.color-picker-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.color-inputs {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.color-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.color-input-group label {
    color: #8b5cf6;
    font-weight: bold;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    background: none;
}

.color-comparison {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.color-display-large {
    width: 150px;
    height: 150px;
    border-radius: 0.25rem;
    border: 2px solid #3a3a3a;
    display: flex;
    align-items: end;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.color-display-large span {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 0.25rem 0.25rem 0 0;
}

.color-values {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.color-value-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-value-row label {
    min-width: 50px;
    color: #8b5cf6;
    font-weight: bold;
}

.color-value-row input {
    flex: 1;
    font-family: 'Courier New', monospace;
}

.color-value-row button {
    padding: 6px 10px;
    font-size: 0.8rem;
}

.color-variations {
    padding: 20px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.color-variations h3 {
    color: #8b5cf6;
    margin-bottom: 20px;
    text-align: center;
}

.variation-section {
    margin-bottom: 20px;
}

.variation-section h4 {
    color: #a1a1aa;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.color-palette {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-swatch {
    width: 50px;
    height: 50px;
    border-radius: 0.25rem;
    border: 2px solid #3a3a3a;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: end;
    justify-content: center;
    overflow: hidden;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #8b5cf6;
}

.color-swatch .swatch-label {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    font-size: 0.7rem;
    border-radius: 0.25rem 0.25rem 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-swatch:hover .swatch-label {
    opacity: 1;
}

button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 1px solid #8b5cf6;
}

button:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.result {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="text"], input[type="url"], input[type="number"], input[type="datetime-local"], textarea, select {
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 0.25rem;
    color: #e5e5e5;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

input[type="text"]:focus, input[type="url"]:focus, input[type="number"]:focus, input[type="datetime-local"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Hash Generator */
.hash-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hash-result {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hash-result label {
    min-width: 60px;
    font-weight: bold;
    color: #8b5cf6;
}

.hash-result input {
    flex: 1;
    min-width: 200px;
}

.hash-result button {
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* QR Code */
.qr-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
    min-height: 200px;
}

#qr-code {
    background: white;
    padding: 10px;
    border-radius: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* JSON */
#json-status {
    padding: 10px;
    border-radius: 0.25rem;
    font-weight: bold;
    text-align: center;
}

.json-valid {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.json-invalid {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

/* URL Shortener */
.url-result {
    display: flex;
    gap: 10px;
    align-items: center;
}

.url-stats {
    padding: 15px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
    margin-top: 15px;
}

/* Text Analyzer */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.stat-label {
    color: #a1a1aa;
}

.stat-value {
    color: #8b5cf6;
    font-weight: bold;
}

.word-frequency {
    margin-top: 20px;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

/* Unit Converter */
.converter-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.converter-section h3 {
    color: #8b5cf6;
    margin-bottom: 15px;
}

.conversion-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.conversion-row input, .conversion-row select {
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 0.25rem;
    color: #e5e5e5;
}

.conversion-row span {
    color: #8b5cf6;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Timestamp Converter */
.timestamp-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.timestamp-section h3 {
    color: #8b5cf6;
    margin-bottom: 15px;
}

.current-time {
    text-align: center;
}

.time-display {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: #8b5cf6;
    margin: 10px 0;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.conversion-result {
    margin-top: 15px;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
    font-family: 'Courier New', monospace;
}

/* Lorem Generator */
.lorem-options {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.lorem-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.lorem-controls input[type="number"] {
    width: 80px;
}

/* Regex Tester */
.regex-input-section {
    margin-bottom: 15px;
}

.regex-flags {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.regex-results {
    margin-top: 20px;
}

.regex-matches {
    padding: 15px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
    margin-bottom: 15px;
}

.regex-highlighted {
    padding: 15px;
    background: #1a1a1a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

.regex-match {
    background: rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
    padding: 2px 4px;
    border-radius: 0.25rem;
}

.regex-presets {
    margin-top: 20px;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 0.25rem;
    border: 1px solid #3a3a3a;
}

.regex-presets h4 {
    color: #8b5cf6;
    margin-bottom: 10px;
}

.regex-presets button {
    margin: 5px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .tool-nav {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .option-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .password-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .color-inputs {
        flex-direction: column;
    }
    
    .color-comparison {
        flex-direction: column;
        align-items: center;
    }
    
    .color-display-large {
        width: 120px;
        height: 120px;
    }
    
    .color-palette {
        justify-content: flex-start;
    }
    
    .color-swatch {
        width: 40px;
        height: 40px;
    }
    
    .result {
        flex-direction: column;
        align-items: stretch;
    }
    
    .conversion-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .lorem-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .lorem-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .regex-flags {
        flex-direction: column;
        gap: 10px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}