:root {
    --md-sys-color-primary: #0061a4;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d1e4ff;
    --md-sys-color-on-primary-container: #001d36;
    --md-sys-color-secondary: #535f70;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #d7e3f7;
    --md-sys-color-on-secondary-container: #101c2b;
    --md-sys-color-tertiary: #535f70;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-tertiary-container: #d7e3f7;
    --md-sys-color-on-tertiary-container: #101c2b;
    --md-sys-color-error: #ba1a1a;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-error-container: #ffdad6;
    --md-sys-color-on-error-container: #410002;
    --md-sys-color-background: #fdfcff;
    --md-sys-color-on-background: #1a1c1e;
    --md-sys-color-surface: #fdfcff;
    --md-sys-color-on-surface: #1a1c1e;
    --md-sys-color-surface-variant: #dfe3eb;
    --md-sys-color-on-surface-variant: #43474e;
    --md-sys-color-outline: #73777f;
    --md-sys-color-surface-container: #f3f4f9;
    --md-sys-color-surface-container-highest: #e2e2e6;
    --md-sys-color-surface-container-high: #e8e8eb;
    --my-sys-color-api-section-bg: #eaf2ff;
}

body {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    padding: 1rem;
}

/* Make top-level container full-bleed so sections can span the full viewport */
.container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0 1rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

/* Hero / site header */
.site-hero {
    position: relative;
    background: linear-gradient(135deg, #0061a4 0%, #6a00f4 50%, #00b37e 100%);
    color: #ffffff;
    padding: 2.75rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.75rem;
}
.site-hero .hero-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    max-width: none; /* allow hero to span full-width */
    margin: 0 auto;
    padding: 0 1rem;
}
.site-hero .hero-left {
    flex: 1 1 60%;
    text-align: center;
}
.site-title {
    font-size: 2.85rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.3px;
    color: #ffffff;
}
.site-tagline {
    font-size: 1.15rem;
    margin: 0.35rem 0 0.65rem;
    font-weight: 600;
    opacity: 0.98;
    color: rgba(255,255,255,0.95);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.site-hero .lead {
    margin-top: 0.5rem;
    color: rgba(255,255,255,0.92);
    margin-bottom: 0;
    font-size: 1rem;
    text-align: center;
}
.hero-illustration{ display: none; }
.hero-cta {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: background 0.2s ease, transform 0.2s ease;
}
.hero-cta:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}
.hero-banner-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 0;
    width: calc(100% - 2rem);
    min-height: 58px;
    border-radius: 12px;
    background: linear-gradient(90deg, #ff2d2d, #d90000);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(217,0,0,0.35);
    border: 2px solid rgba(255,255,255,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-banner-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(217,0,0,0.4);
}

/* Top navigation inside hero */
.site-nav {
    width: 100%;
    margin-bottom: 1rem;
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.nav-logo {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 1px;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}
.nav-link {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease;
}
.nav-link:hover, .nav-link:focus {
    background: rgba(255,255,255,0.08);
    outline: none;
}
.nav-cta .btn-primary {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    color: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
    transition: transform 160ms ease, background 160ms ease;
}
.nav-cta .btn-primary:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.18);
}

/* Small screens: collapse nav links into simple layout */
@media (max-width: 680px) {
    .nav-inner { flex-direction: row; align-items: center; }
    .nav-links { display: none; }
}

/* Responsive adjustments */
@media (max-width: 880px) {
    .site-hero .hero-inner { flex-direction: column; text-align: center; }
    .hero-illustration { width: 120px; margin-top: 0.5rem; }
    .site-title { font-size: 1.6rem; }
}

@media (max-width: 420px) {
    .site-title { font-size: 1.4rem; }
    .site-tagline { font-size: 0.9rem; }
    main { padding: 1rem; }
}

/* Footer styles */
.site-footer {
    margin-top: 2rem;
    background: linear-gradient(135deg, rgba(0,97,164,0.95) 0%, rgba(106,0,244,0.95) 50%, rgba(0,179,126,0.95) 100%);
    color: #fff;
    padding: 1.5rem 1rem;
    border-radius: 12px;
}
.site-footer .footer-inner {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    flex-wrap: wrap;
    text-align: left;
}
.footer-brand { font-weight: 800; font-size: 1.05rem; }
.footer-desc { margin: 0.4rem 0 0; color: rgba(255,255,255,0.92); font-size: 0.95rem; max-width: 60ch; line-height:1.45; }
.footer-links { display:flex; gap: 0.75rem; align-items:center; flex-wrap: wrap; }
.footer-link { color: rgba(255,255,255,0.95); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 8px; font-weight: 600; }
.footer-link:hover { background: rgba(255,255,255,0.06); }
.footer-left { flex: 1 1 60%; min-width: 220px; max-width: calc(100% - 220px); }
.footer-right { flex: 0 0 auto; text-align: left; color: rgba(255,255,255,0.9); font-size: 0.95rem; min-width: 160px; margin-left: auto; }

@media (max-width: 880px) {
    .site-footer .footer-inner { flex-direction: column; text-align: left; gap: 0.6rem; align-items: flex-start; }
    .footer-right { text-align: left; margin-left: 0; }
    .footer-brand { font-size: 1rem; }
    .footer-desc { font-size: 0.95rem; }
}
    
main {
    background-color: transparent;
    padding: 1.5rem 1rem;
}

/* White card wrapper for the form area */
.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.04);
}

@media (max-width: 880px) {
    .card { padding: 1rem; border-radius: 12px; }
}

.form-section {
    margin-bottom: 1.25rem;
}
.form-section:last-child {
    margin-bottom: 0;
}
.form-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--md-sys-color-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}
.form-section h2 .material-symbols-outlined {
    margin-right: 0.75rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
    
md-outlined-text-field, md-outlined-select {
    width: 100%;
    --md-outlined-field-container-shape: 16px;
    --md-menu-container-color: var(--md-sys-color-surface-container);
}
    
md-select-option {
    --md-menu-item-selected-container-color: var(--md-sys-color-primary-container);
    --md-menu-item-selected-label-text-color: var(--md-sys-color-on-primary-container);
    --md-menu-item-hover-state-layer-color: var(--md-sys-color-on-surface);
    --md-menu-item-focus-state-layer-color: var(--md-sys-color-on-surface);
    --md-menu-item-pressed-state-layer-color: var(--md-sys-color-on-surface);
    --md-menu-item-hover-state-layer-opacity: 0.08; 
    --md-menu-item-focus-state-layer-opacity: 0.12;
    --md-menu-item-pressed-state-layer-opacity: 0.12;
}

#api-key-section {
    background-color: var(--my-sys-color-api-section-bg);
    color: var(--md-sys-color-on-primary-container);
    border-radius: 16px;
    padding: 1.25rem;
}

.actions-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
    
/* Two-column layout: main content + right sidebar for results */
.content-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1rem;
    align-items: start;
}

#result-container {
    background: linear-gradient(180deg, #eaf6ff 0%, #d9f0ff 100%);
    color: #073b4c;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0;
    position: sticky;
    top: 1.5rem;
    height: fit-content;
    align-self: start;
    box-shadow: 0 10px 28px rgba(10, 46, 70, 0.06);
    border: 1px solid rgba(7,59,76,0.08);
}

/* On smaller screens stack the layout and disable sticky behaviour */
@media (max-width: 880px) {
    .content-area { grid-template-columns: 1fr; }
    #result-container { position: relative; margin-top: 1.5rem; top: auto; }
}
    
#prompt-output {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--md-sys-color-on-surface-variant);
}
    
#copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    color: #073b4c;
}

.card .form-section { padding-bottom: 0.75rem; }
.card .form-section + .form-section { border-top: 1px solid rgba(15,23,42,0.03); padding-top: 1rem; }
    
.loader {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    border-top: 3px solid #FFF;
    border-right: 3px solid transparent;
    box-sizing: border-box;
    animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

