/* UglyURL Stylesheet */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-color: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --code-bg: #f3f4f6;
    --ugly-color: #dc2626;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Main content */
main {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

/* Description */
.description {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* Form */
.uglify-form {
    margin-bottom: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: background 0.2s;
}

.form-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
}

.form-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

#ugliness-value {
    color: var(--primary-color);
    font-weight: 700;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.button-group .btn-primary,
.button-group .btn-secondary {
    flex: 1;
    width: auto;
}

/* Examples section */
.examples {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.examples h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-color);
}

.example {
    margin-bottom: 1rem;
}

.example-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.example-url {
    display: block;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: 6px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    word-break: break-all;
    border: 1px solid var(--border-color);
}

.example-url.ugly {
    color: var(--ugly-color);
}

.example-note {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Features section */
.features {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.features h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--text-color);
}

.features ul {
    list-style: none;
    padding: 0;
}

.features li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    color: var(--text-muted);
}

.features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* Result page */
.success-message {
    text-align: center;
    margin-bottom: 2rem;
}

.success-message h2 {
    color: var(--success-color);
    font-size: 1.75rem;
}

.result-section {
    margin-bottom: 2rem;
}

.result-section h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

.url-box {
    padding: 1rem;
    background: var(--code-bg);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.url-box.ugly {
    border-color: var(--ugly-color);
    background: #fef2f2;
}

.url-box code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    display: block;
}

.url-box.ugly code {
    color: var(--ugly-color);
}

.url-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-weight: 600;
}

.stat-value {
    margin-right: 1rem;
}

.stat-value.increase {
    color: var(--ugly-color);
    font-weight: 600;
}

.stat-separator {
    margin: 0 0.5rem;
}

/* Stats section */
.stats-section {
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
}

.stats-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Info box */
.info-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

.info-box h4 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.info-box p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.info-box ul {
    margin-left: 1.5rem;
    color: var(--text-muted);
}

.info-box ul li {
    margin-bottom: 0.5rem;
}

.privacy-note {
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Error page */
.error-message {
    text-align: center;
    margin-bottom: 2rem;
}

.error-message h2 {
    color: var(--error-color);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.error-box {
    padding: 1.5rem;
    background: #fef2f2;
    border: 2px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    font-weight: 500;
}

/* Actions */
.actions {
    text-align: center;
    margin: 2rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Copy button feedback */
.btn-primary.copied {
    background: var(--success-color);
}

.btn-primary.copied::after {
    content: " ✓";
}
