:root {
    --bg-color: #f8f9fa; /* Google Page Background */
    --card-bg: #ffffff;  /* Google Card White */
    --card-border: #dadce0; /* Google Standard Border */
    --card-hover-border: #bdc1c6;
    
    --google-blue: #1a73e8;
    --google-blue-hover: #1557b0;
    --google-blue-light: #e8f0fe;
    
    --google-red: #ea4335;
    --google-yellow: #fbbc05;
    --google-green: #34a853;
    
    --text-primary: #202124;    /* Google Dark Text */
    --text-secondary: #5f6368;  /* Google Medium Gray Text */
    --text-muted: #70757a;      /* Google Light Gray Text */
    
    --input-bg: #ffffff;
    --input-border: #dadce0;
    --input-focus: #1a73e8;
    
    --font-sans: 'Roboto', 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Roboto', 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --shadow-lg: 0 4px 6px 0 rgba(60,64,67,0.2), 0 10px 20px 6px rgba(60,64,67,0.1);
    
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Remove absolute glow container to make it clean like Google */
.glow-bg {
    display: none;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 24px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Add subtle Google colors to Logo text */
.logo-text span {
    font-weight: 400;
    color: var(--google-blue);
}

.subtitle-text {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
    font-weight: 400;
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

@media (min-width: 800px) {
    .main-grid {
        grid-template-columns: 1.1fr 1fr;
    }
}

/* Material 3 Outlined Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: none;
    transition: box-shadow var(--transition-smooth), border-color var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: var(--card-hover-border);
    box-shadow: 0 1px 3px rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Google-style Tabs */
.tabs-container {
    display: flex;
    border-bottom: 1px solid #e8eaed;
    padding: 0;
    margin-bottom: 24px;
    background: none;
    border-radius: 0;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 8px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 0;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(32, 33, 36, 0.04);
}

.tab-btn.active {
    color: var(--google-blue);
    border-bottom: 3px solid var(--google-blue);
    background: none;
    box-shadow: none;
    font-weight: 500;
}

.tab-icon {
    opacity: 0.8;
}

.tab-btn.active .tab-icon {
    opacity: 1;
    color: var(--google-blue);
}

/* Tab Content */
.tab-content {
    display: none;
    flex-grow: 1;
}

.tab-content.active {
    display: block;
}

/* Forms & Inputs */
.generator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

select, input[type="text"], input[type="number"], textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

select:focus, input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
    border-color: var(--input-focus);
    border-width: 1px;
    box-shadow: inset 0 0 0 1px var(--input-focus);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.4;
}

.help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Slider Style */
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-wrapper input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #e8eaed;
    border-radius: 2px;
    outline: none;
}

.slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--google-blue);
    cursor: pointer;
    box-shadow: none;
    transition: transform var(--transition-fast);
}

.slider-wrapper input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-wrapper input[type="number"] {
    width: 72px;
    text-align: center;
    padding: 6px;
}

/* Custom Checkbox */
.checkbox-group {
    margin-top: 6px;
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 28px;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    user-select: none;
    color: var(--text-primary);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 1px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--input-bg);
    border: 1.5px solid var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--text-primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--google-blue);
    border-color: var(--google-blue);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Pill-shaped Material Buttons */
.action-wrapper {
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 24px;
    border-radius: 100px; /* Google Pill Shape */
    border: none;
    cursor: pointer;
    width: 100%;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary {
    background-color: var(--google-blue);
    color: white;
    box-shadow: none;
}

.btn-primary:hover {
    background-color: var(--google-blue-hover);
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.btn-secondary {
    background-color: #ffffff;
    border: 1px solid var(--card-border);
    color: var(--google-blue);
}

.btn-secondary:hover {
    background-color: var(--google-blue-light);
    border-color: #d2e3fc;
}

.btn-icon {
    color: currentColor;
}

/* Preview Card Specifics */
.preview-card {
    justify-content: space-between;
}

.preview-stage {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    min-height: 280px;
}

.preview-frame {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
    border-radius: 12px;
    background-color: #f1f3f4; /* Google light gray canvas bg */
    border: 1px solid var(--card-border);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#code-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

.placeholder-icon {
    stroke: var(--text-secondary);
    opacity: 0.7;
}

/* Google-style Loader */
.loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3.5px solid rgba(26, 115, 232, 0.1);
    border-top-color: var(--google-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.preview-actions {
    width: 100%;
}

/* Footer */
.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 30px;
    border-top: 1px solid #e8eaed;
    padding-top: 20px;
}
