:root {
    /* Lighter "Day Mode" Glass */
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --text-main: #1d1d1f;
    /* Apple Dark Gray */
    --text-muted: rgba(0, 0, 0, 0.6);
    --primary-color: #34c759;
    /* iOS Green */
    --accent-color: #007aff;
    /* iOS Blue */
    --card-radius: 40px;
    --input-radius: 12px;
    --input-bg: rgba(0, 0, 0, 0.05);
    --input-border: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    /* Day Mesh Gradient */
    background-color: #f0f0f3;
    background-image:
        radial-gradient(at 0% 0%, hsla(280, 100%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(240, 100%, 92%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(200, 100%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(330, 100%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(50, 100%, 88%, 1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: moveGradient 15s ease infinite alternate;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

@keyframes moveGradient {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

/* Ambient Blobs (Lighter) */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    /* animation: float 20s infinite ease-in-out; */
    will-change: transform;
    /* Optimization for painting */
}

.blob-1 {
    top: 10%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: #d8b4fe;
    /* animation-delay: 0s; */
}

.blob-2 {
    bottom: 10%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: #93c5fd;
    /* animation-delay: -5s; */
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: #fca5a5;
    /* animation-delay: -10s; */
}

/* @keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
} */

.container {
    width: 100%;
    max-width: 900px;
    min-width: 0; /* allow shrink inside flex layout */
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--card-radius);
    padding: 40px;
    margin: 0 auto;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -1px;
    color: #1d1d1f;
}

p.description {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

p.disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 12px auto 0;
    line-height: 1.45;
    opacity: 0.85;
}

/* Drop Zone */
.drop-zone {
    background: rgba(255, 255, 255, 0.4);
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-bottom: 40px;
}

.drop-zone:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--accent-color);
    transform: scale(1.01);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.drop-zone p {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 24px;
    color: #1d1d1f;
}

.upload-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.btn-glass:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Settings Group */
.settings-group {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    min-width: 0; /* allow shrink in flex so pills can wrap in responsive */
}

.setting-item:first-child {
    border-radius: 24px 24px 0 0;
}

.setting-item:last-child {
    border-bottom: none;
    border-radius: 0 0 24px 24px;
}

.setting-item:only-child {
    border-radius: 24px;
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.setting-label {
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0; /* allow shrink so pills wrap in narrow/column layout */
}

/* iOS Switch */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e5ea;
    /* Light Gray */
    transition: .4s;
    border-radius: 34px;
}

.ios-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.ios-slider {
    background-color: var(--primary-color);
}

input:checked+.ios-slider:before {
    transform: translateX(20px);
}

/* Pills with Checkmarks */
.checkbox-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.pill-checkbox {
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.pill-checkbox input {
    opacity: 0;
    position: absolute;
}

.pill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pill-checkbox input:checked+.pill-label {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Checkmark icon hidden by default */
.pill-label svg {
    width: 14px;
    height: 14px;
    display: none;
    fill: white;
    stroke: white;
    stroke-width: 3;
}

.pill-checkbox input:checked+.pill-label svg {
    display: block;
}

/* Inputs */
.glass-input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--input-radius);
    padding: 10px 16px;
    color: #1d1d1f;
    font-size: 16px;
    font-family: inherit;
    width: 200px;
    text-align: right;
    margin: 0;
    transition: all 0.2s;
}

.glass-input:focus {
    background: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    outline: none;
}

.glass-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.wide-input {
    width: 100%;
    text-align: left;
    margin-top: 10px;
    box-sizing: border-box;
}

/* Select */
.glass-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--input-radius);
    padding: 10px 32px 10px 16px;
    color: #1d1d1f;
    font-size: 16px;
    font-family: inherit;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2210%22%20height%3D%226%22%20viewBox%3D%220%200%2010%206%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201L5%205L9%201%22%20stroke%3D%22%231D1D1F%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.glass-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    outline: none;
}

.glass-select option {
    background: #1c1c1e;
    color: white;
}

/* Large Action Button */
.action-area {
    text-align: center;
    margin-top: 40px;
}

.btn-convert {
    background: #1d1d1f;
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 60px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-convert:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.btn-convert:active {
    transform: scale(0.97);
}

.btn-convert:disabled {
    background: #d2d2d7;
    box-shadow: none;
    cursor: not-allowed;
}

/* Live Preview & Log */
.preview-container {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.preview-box {
    font-size: 36px;
    outline: none;
    min-height: 80px;
    color: #1d1d1f;
}

.log-box {
    margin-top: 20px;
    font-family: 'SF Mono', monospace;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    white-space: pre-wrap;
    max-height: 100px;
    overflow-y: auto;
}

.section-title {
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: block;
    margin-left: 24px;
}

/* Icon helpers */
.icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Content Section for SEO/AdSense */
.content-section {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--card-radius);
    padding: 40px;
    box-sizing: border-box;
    color: #1d1d1f;
    will-change: transform;
    /* Optimization for backdrop-filter */
    transform: translateZ(0);
    /* Force hardware accl */
}

.content-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #1d1d1f;
}

.content-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
}

.content-section p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.content-section ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.content-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 40px 0;
    font-size: 14px;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.2s;
}

/* Global Navigation */
.global-nav {
    position: relative;
    margin: 0 auto 40px auto;
    width: 90%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    z-index: 1000;
    padding: 12px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    transform: translateZ(0);
}

.nav-brand {
    font-weight: 700;
    font-size: 18px;
    color: #1d1d1f;
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: anchor-center;
}

.nav-links a {
    color: #1d1d1f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    opacity: 0.8;
}

.nav-links a:hover {
    color: var(--accent-color);
    opacity: 1;
}

.nav-links a.active {
    color: var(--accent-color);
    font-weight: 600;
    opacity: 1;
}

/* Adjust footer styling specifically */
footer {
    margin-top: auto;
    width: 100%;
    max-width: 900px;
}

footer a:hover {
    color: var(--accent-color);
}

.highlight-box {
    background: rgba(52, 199, 89, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 40px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

/* 3-column layout: center max 800px, left/right share remaining space equally */
.layout-row {
    display: flex;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.col-left,
.col-right {
    flex: 1 1 0;
    min-width: 0;
}

.col-center {
    flex: 0 1 867px;
    max-width: 867px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Prevent main/content from overflowing the center column (flex min-width: auto) */
.col-center > main {
    min-width: 0;
    width: 100%;
}

.col-left .ad-slot,
.col-right .ad-slot {
    position: sticky;
    top: 24px;
}

.col-center > .global-nav {
    width: 100%;
    max-width: 100%;
}

.col-center > footer {
    width: 100%;
    max-width: 100%;
}

/* Responsive Layouts */

@media (max-width: 900px) {
    .col-left,
    .col-right {
        display: none;
    }

    .col-center {
        flex: 1 1 100%;
    }

    .layout-row {
        padding-left: 0;
        padding-right: 0;
    }

    body {
        padding: 32px 16px;
    }

    .global-nav {
        width: 100%;
        padding-inline: 20px;
    }

    .container,
    .content-section {
        padding: 28px 20px;
        border-radius: 28px;
    }

    .drop-zone {
        padding: 28px 20px;
    }

    .upload-btns {
        flex-wrap: wrap;
    }

    .settings-group {
        border-radius: 20px;
    }

    .setting-item:first-child {
        border-radius: 20px 20px 0 0;
    }

    .setting-item:last-child {
        border-radius: 0 0 20px 20px;
    }

    .setting-item:only-child {
        border-radius: 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 24px 12px;
    }

    h1 {
        font-size: 32px;
    }

    .global-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        border-radius: 32px;
    }

    .nav-brand {
        font-size: 16px;
    }

    .nav-logo {
        width: 26px;
        height: 26px;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .nav-links a {
        font-size: 13px;
    }

    .container,
    .content-section {
        padding: 24px 18px;
    }

    header {
        text-align: left;
    }

    p.description {
        margin-left: 0;
    }

    .drop-zone {
        padding: 24px 18px;
    }

    .upload-btns {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-glass {
        justify-content: center;
        width: 100%;
    }

    .settings-group {
        margin-bottom: 24px;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .setting-control {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .checkbox-pills {
        flex-wrap: wrap;
    }

    .glass-input {
        width: 100%;
        text-align: left;
    }

    .glass-select {
        width: 100%;
    }

    .preview-container {
        padding: 24px 18px;
    }

    .preview-box {
        font-size: 24px;
    }

    .section-title {
        margin-left: 8px;
    }

    .content-section h2 {
        font-size: 24px;
    }

    .content-section h3 {
        font-size: 18px;
    }

    footer {
        padding: 24px 0 32px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }

    .global-nav {
        padding: 10px 16px;
        border-radius: 24px;
    }

    .nav-brand {
        font-size: 16px;
    }

    .nav-logo {
        width: 24px;
        height: 24px;
    }

    .nav-links {
        column-gap: 16px;
    }

    h1 {
        font-size: 28px;
    }

    .preview-box {
        font-size: 20px;
    }

    .drop-zone p {
        font-size: 18px;
    }

    .container,
    .content-section {
        padding: 20px 16px;
        border-radius: 22px;
    }

    .content-section h2 {
        font-size: 22px;
    }

    .content-section h3 {
        font-size: 17px;
    }
}

.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24
}

/* Buy Me a Coffee Floating Button */
.bmc-button {
    border: none;
    padding: 12px 32px;
    border-radius: 60px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    /* transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); */
}

.bmc-button:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.bmc-button:active {
    transform: translateY(0) scale(0.98);
}


.bmc-button span {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #1d1d1f;
    letter-spacing: -0.3px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .bmc-button {
        bottom: 20px;
        right: 20px;
        padding: 10px 20px;
    }

}

@keyframes bounceRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* Blue Button Modifier */
.btn-blue {
    background-color: var(--accent-color); /* #007aff */
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3);
    color: white !important; /* Ensure text is white */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-blue:hover {
    background-color: #0062cc; /* Darker blue on hover */
    box-shadow: 0 15px 40px rgba(0, 122, 255, 0.4);
    transform: scale(1.03);
    color: white;
}

.btn-blue:active {
    transform: scale(0.97);
}



/* Navbar Icon Link */
.nav-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    opacity: 0.8;
    transition: all 0.2s;
}

.nav-icon-link:hover {
    color: #FFDD00; /* Coffee yellow on hover */
    opacity: 1;
    transform: scale(1.1);
}

.nav-icon-link svg {
    width: 20px;
    height: 20px;
}
