:root {
    --bg-color: #0f172a;
    --container-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #334155;
    --input-bg: #0f172a;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem; /* Scaled down */
}

/* Navigation & Logo */
.top-nav {
    padding: 1.25rem 1.5rem;
    width: 100%;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo::after {
    content: '.';
    color: var(--accent-color);
}

/* Main Container */
.container {
    max-width: 800px; /* Reduced for 80% look */
    margin: 1.5rem auto;
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    flex: 1;
    width: 95%;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Form Sections */
main {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.85rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

textarea::placeholder {
    color: #475569;
}

/* Controls Spacing */
.controls {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    margin: 0.25rem 0;
}

/* Options Section - Clean Row */
.options-section {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    align-items: center;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: max-content;
}

.option-group:nth-child(2) {
    justify-content: center;
}

.option-group:nth-child(3) {
    justify-content: flex-end;
}

.option-group label {
    margin-bottom: 0;
    white-space: nowrap;
}

.styled-select, .styled-input {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: border-color 0.2s;
    flex: 1;
    max-width: 100%;
}

.styled-select:focus, .styled-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    min-width: max-content;
}

.checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.checkbox-group label {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    font-size: 0.85rem;
}

/* Button Styling & Hover Effects */
button {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-btn {
    background-color: var(--accent-color);
    color: white;
    flex: 2;
    max-width: 250px;
}

.primary-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.secondary-btn {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    flex: 1;
    max-width: 130px;
}

.secondary-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
}

#clearBtn {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

#clearBtn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Output Section */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.output-header label {
    margin-bottom: 0;
}

.output-actions {
    display: flex;
    gap: 0.6rem;
}

.output-actions .secondary-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.copied {
    color: var(--success-color) !important;
    border-color: var(--success-color) !important;
}

/* Footer Navigation */
footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.separator {
    color: var(--border-color);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1.25rem;
        margin-top: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .controls {
        flex-direction: column;
        gap: 0.85rem;
    }

    .options-section {
        flex-direction: column;
        gap: 1.25rem;
        align-items: stretch;
    }

    .option-group {
        width: 100%;
        justify-content: flex-start !important;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }

    .output-actions {
        width: 100%;
        justify-content: space-between;
    }
}
