@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --input-bg: #F8FAFC;
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem;
    position: relative;
    overflow-x: hidden;
    
    /* Clean, soft dot pattern background */
    background-color: #F8FAFC;
    background-image: radial-gradient(#CBD5E1 1px, transparent 1px);
    background-size: 24px 24px;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

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

header h1 {
    font-size: 3.25rem;
    font-weight: 700;
    color: var(--text-main); /* Removed gradient */
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

header p {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Solid Clean Card */
.converter-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 
        0 20px 40px -10px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.02);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 800px) {
    .converter-box {
        grid-template-columns: 1fr 1fr;
        padding: 3.5rem;
    }
}

.input-section {
    display: flex;
    flex-direction: column;
}

/* PERFECT ALIGNMENT FOR HEADERS */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

/* Premium Segmented Control */
.segmented-control {
    display: inline-flex;
    background: #F1F5F9;
    padding: 4px;
    border-radius: 12px;
    position: relative;
    border: 1px solid #E2E8F0;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.segmented-control input[type="radio"]:checked + label {
    color: var(--primary-color);
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.textarea-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Redesigned Textareas */
textarea {
    flex: 1;
    width: 100%;
    min-height: 240px;
    padding: 1.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: var(--text-main);
    resize: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

textarea:focus {
    outline: none;
    border-color: #A5B4FC;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), inset 0 2px 4px rgba(0,0,0,0.01);
    background: #FFFFFF;
}

textarea::placeholder {
    color: #94A3B8;
    font-weight: 300;
}

#outputText {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1.05rem;
    background: #F8FAFC;
    color: var(--text-muted);
    line-height: 1.6;
    padding-bottom: 4rem; /* Leave room for floating button */
}

#outputText.has-content {
    color: var(--primary-color);
    font-weight: 500;
    background: #EEF2FF;
    border-color: #C7D2FE;
}

/* Custom Scrollbar */
textarea::-webkit-scrollbar {
    width: 8px;
}
textarea::-webkit-scrollbar-track {
    background: transparent;
}
textarea::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
textarea::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Floating Sleek Copy Button */
.copy-btn {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.6rem 1.25rem;
    border-radius: 100px; /* Pill shape */
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-btn svg {
    color: var(--primary-color);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    border-color: #CBD5E1;
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.success {
    color: #FFFFFF;
    background: #10B981;
    border-color: #10B981;
}
.copy-btn.success svg {
    color: #FFFFFF;
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.95);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #E2E8F0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-indicator.hidden {
    display: none;
}

footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}
