/* CSS Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    --success-color: #10b981;
    --success-hover: #059669;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px 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);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

header .subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Section Styles */
.input-section,
.output-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea::placeholder {
    color: var(--text-secondary);
}

#output-text {
    background: var(--background);
}

/* Input/Output Actions */
.input-actions,
.output-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: center;
}

.output-actions {
    justify-content: flex-start;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

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

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: var(--success-hover);
}

/* Conversion Buttons Section */
.conversion-buttons {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.conversion-buttons h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.convert-btn {
    flex-direction: column;
    padding: 1rem;
    min-height: 80px;
    gap: 0.25rem;
}

.convert-btn .btn-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.convert-btn .btn-example {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Copy Feedback */
.copy-feedback {
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.copy-feedback.show {
    opacity: 1;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 2rem 0 1rem;
    margin-top: auto;
}

footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

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

    header h1 {
        font-size: 2rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    .btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .convert-btn {
        min-height: 70px;
    }

    textarea {
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.75rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .input-section,
    .output-section,
    .conversion-buttons {
        padding: 1rem;
    }

    .btn-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .convert-btn {
        padding: 0.75rem;
        min-height: 65px;
    }

    .convert-btn .btn-label {
        font-size: 0.8rem;
    }

    .convert-btn .btn-example {
        font-size: 0.65rem;
    }

    .input-actions,
    .output-actions {
        flex-wrap: wrap;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Dark mode support (optional, follows system preference) */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #111827;
        --surface: #1f2937;
        --text-primary: #f9fafb;
        --text-secondary: #9ca3af;
        --border-color: #374151;
    }

    textarea {
        background: var(--surface);
        color: var(--text-primary);
    }

    #output-text {
        background: #0f172a;
    }

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

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