/* ==========================================================================
   PixelAI Studio - Google AI Professional Styling
   ========================================================================= */
:root {
    --bg-primary: #f0f4f9;
    /* Workspace background */
    --bg-secondary: #ffffff;
    /* Card and input background */
    --text-primary: #1f1f1f;
    /* Primary charcoal text */
    --text-secondary: #444746;
    /* Secondary grey label */
    --text-muted: #5f6368;

    --google-blue: #1a73e8;
    --google-blue-hover: #1b66ca;
    --google-blue-bg: #e8f0fe;

    --border-neutral: #dadce0;
    --border-active: #1a73e8;

    --pixelai-gradient: linear-gradient(74deg, #0ea5e9 0%, #9b72cb 18%, #d96570 38%, #38bdf8 68%, #b47ae5 100%);
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.05);

    --font-heading: 'Outfit', 'Google Sans', sans-serif;
    --font-body: 'Inter', 'Roboto', sans-serif;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 100px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* ==========================================================================
   PixelAI Wave Decor Elements
   ========================================================================== */
.pixelai-decor {
    position: fixed;
    border-radius: var(--radius-full);
    filter: blur(160px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.decor-1 {
    width: 600px;
    height: 600px;
    top: -150px;
    left: -150px;
    background: radial-gradient(circle, #0ea5e9 0%, rgba(255, 255, 255, 0) 70%);
}

.decor-2 {
    width: 500px;
    height: 500px;
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, #9b72cb 0%, rgba(255, 255, 255, 0) 70%);
}

/* ==========================================================================
   App Layout (Wider container for split workspace alignment)
   ========================================================================== */
.app-layout {
    width: 100%;
    max-width: 1140px;
    padding: 36px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: 100vh;
}

.hide {
    display: none !important;
}

/* ==========================================================================
   Header Component (Space-between Alignment)
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-neutral);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pixelai-gradient {
    background: var(--pixelai-gradient);
    animation: rotateGradient 12s infinite linear;
    background-size: 200% 200%;
}

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

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

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

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.6px;
    color: #1f1f1f;
}

.logo-text h1 span {
    background: var(--pixelai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
}

.sub-logo {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* ==========================================================================
   Workspace Card (Professional Desktop 2-Column Split Alignment)
   ========================================================================== */
.workspace-centered {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.studio-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 36px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    position: relative;
    overflow: hidden;
    align-items: start;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field-label {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.textarea-wrapper {
    background: #f0f4f9;
    /* Google input light background */
    border: 1px solid transparent;
    border-radius: 20px;
    transition: var(--transition);
}

.textarea-wrapper:focus-within {
    background: #ffffff;
    border-color: var(--border-active);
    box-shadow: 0 0 0 1px var(--border-active);
}

.textarea-wrapper textarea {
    width: 100%;
    height: 110px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 16px 20px;
    resize: none;
    line-height: 1.5;
}

.textarea-wrapper textarea::placeholder {
    color: #757575;
}

/* Category Chips (Google capsules style) */
.category-wrapper {
    margin-bottom: 4px;
}

.field-label-sm {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-chip {
    background: #ffffff;
    border: 1px solid var(--border-neutral);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.category-chip:hover {
    background: #f1f3f4;
    border-color: #c4c7c5;
}

.category-chip.active {
    background: var(--google-blue-bg);
    border-color: var(--border-active);
    color: var(--google-blue);
    font-weight: 600;
}

/* Generate Button */
.btn-generate {
    background: var(--google-blue);
    color: white;
    border: none;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
    transition: var(--transition);
}

.btn-generate:hover:not(:disabled) {
    background: var(--google-blue-hover);
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px rgba(60, 64, 67, 0.15);
}

.btn-generate:disabled {
    background: #e3e3e3;
    color: #9e9e9e;
    cursor: not-allowed;
}

.btn-generate i {
    font-size: 1rem;
}

/* Image preview section */
.output-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.image-frame {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: #f0f4f9;
    border: 1px solid var(--border-neutral);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.canvas-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    max-width: 320px;
}

/* Empty State */
.empty-state i {
    font-size: 3rem;
    color: #a8c7fa;
    margin-bottom: 12px;
}

.canvas-state h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.canvas-state p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Loading State Wave Sweep (Signature Gemini Style) */
.image-frame.loading-active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(240, 244, 249, 0) 0%, rgba(168, 199, 250, 0.2) 50%, rgba(240, 244, 249, 0) 100%);
    background-size: 200% 100%;
    animation: loadingWave 1.4s infinite linear;
}

@keyframes loadingWave {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(26, 115, 232, 0.1);
    border-top: 3px solid var(--google-blue);
    animation: spin 0.8s infinite linear;
    margin-bottom: 16px;
}

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

/* Error State */
.error-state i {
    font-size: 2.8rem;
    color: #db4437;
    margin-bottom: 12px;
}

/* Image Render styling */
.image-wrapper {
    width: 100%;
    height: 100%;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: zoomReveal var(--transition);
}

@keyframes zoomReveal {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Action button bar */
.action-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.btn-action {
    flex: 1;
    border: 1px solid var(--border-neutral);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-download {
    background: #ffffff;
    color: var(--google-blue);
    border-color: var(--border-neutral);
}

.btn-download:hover {
    background: var(--google-blue-bg);
    border-color: var(--google-blue);
}

.btn-copy {
    background: #ffffff;
    color: var(--text-primary);
}

.btn-copy:hover {
    background: #f1f3f4;
}

/* ==========================================================================
   Info Section (Gemini Card Style)
   ========================================================================== */
.info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 36px;
    width: 100%;
}

.info-header {
    margin-bottom: 24px;
    text-align: center;
}

.info-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.info-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.info-card {
    background: #ffffff;
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.info-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border-color: #c4c7c5;
}

.info-icon {
    font-size: 1.6rem;
    color: var(--google-blue);
    margin-bottom: 12px;
}

.info-card h3 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.info-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.tips-box {
    background: var(--google-blue-bg);
    border: 1px solid rgba(26, 115, 232, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
}

.tips-box h3 {
    font-family: var(--font-heading);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--google-blue);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-box ul {
    list-style-type: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tips-box li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    position: relative;
    padding-left: 18px;
}

.tips-box li::before {
    content: "•";
    color: var(--google-blue);
    position: absolute;
    left: 6px;
    font-weight: bold;
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
.app-footer {
    text-align: center;
    padding-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.app-footer strong {
    color: var(--google-blue);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 640px) {
    .app-layout {
        padding: 20px 12px;
        gap: 20px;
    }

    .app-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 12px;
        width: 100%;
    }

    .studio-card {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        gap: 24px;
    }

    .btn-generate {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-section {
        padding: 20px;
    }

    .plans-container {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Navigation Links
   ========================================================================== */
.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.nav-link:hover {
    background: #f1f3f4;
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--google-blue-bg);
    color: var(--google-blue);
    font-weight: 600;
}

/* ==========================================================================
   Page Views and Transition
   ========================================================================== */
.page-view {
    width: 100%;
    animation: viewFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes viewFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Landing Home View Details
   ========================================================================== */
.hero-section {
    text-align: center;
    padding: 56px 0;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--google-blue);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.hero-title span {
    background: var(--pixelai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.btn-hero {
    align-self: center;
    padding: 16px 36px;
    font-size: 1.05rem;
    margin-top: 8px;
}

/* Showcase grid styles */
.showcase-section {
    padding: 40px 0 16px;
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.showcase-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: var(--transition);
    cursor: pointer;
}

.showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
    border-color: #c4c7c5;
}

.showcase-img-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase-icon {
    font-size: 1.4rem;
}

.showcase-card h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.showcase-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Showcase mobile rules */
@media (max-width: 768px) {
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 1.8rem;
    }


    .studio-credits-dashboard {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
        padding: 14px 16px;
    }

    .dashboard-metrics {
        justify-content: center;
    }

    .btn-upgrade-pricing {
        justify-content: center;
    }

    /* Responsive Modals and Plan Cards overrides */
    .modal-backdrop {
        padding: 20px 10px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .plan-card {
        padding: 16px;
    }

    .plan-price {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .plan-features {
        gap: 8px;
        margin-bottom: 16px;
    }

    .sub-header {
        margin-bottom: 16px;
    }

    .sub-header h2 {
        font-size: 1.35rem;
    }

    .sub-header p {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   Showcase Preview Upgrades
   ========================================================================== */
.showcase-img-box {
    width: 100%;
    aspect-ratio: 4/3;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f4f9;
}

.showcase-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.showcase-card:hover .showcase-img-box img {
    transform: scale(1.05);
}

.showcase-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* ==========================================================================
   Textarea Actions and Clear Button
   ========================================================================== */
.textarea-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 12px;
    background: transparent;
}

#char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-clear:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

/* ==========================================================================
   Loading Log Feed
   ========================================================================== */
.log-feed {
    margin-top: 8px;
    min-height: 20px;
}

#log-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--google-blue);
    animation: pulseText 1.5s infinite alternate;
}

@keyframes pulseText {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================================================
   Toast Notification Banner
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-left: 4px solid var(--google-blue);
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    animation: slideInToast 0.35s cubic-bezier(0.16, 1, 0.3, 1), fadeOutToast 0.35s forwards 2.65s;
    min-width: 260px;
}

.toast i {
    font-size: 1.1rem;
    color: var(--google-blue);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-success i {
    color: #10b981;
}

@keyframes slideInToast {
    from {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes fadeOutToast {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }
}

/* ==========================================================================
   Authentication Navigation Button
   ========================================================================== */
.btn-auth-outline {
    background: transparent;
    border: 1px solid var(--border-neutral);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-auth-outline:hover {
    background: #f1f3f4;
    border-color: #c4c7c5;
    color: var(--text-primary);
}

/* ==========================================================================
   Authentication Modal Backdrop and Cards
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
    animation: backdropFadeIn 0.25s forwards;
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--border-neutral);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin: auto;
}

@keyframes modalSlideDown {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.auth-header-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.auth-header-logo.logo-circle {
    border-radius: 50%;
    overflow: hidden;
    background: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-header-logo.logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.4;
}

/* Auth Forms */
.auth-card form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    background: #ffffff;
    border: 1px solid var(--border-neutral);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.form-group input:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 1px var(--border-active);
}

.btn-auth-submit {
    width: 100%;
    align-self: stretch;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 8px;
}

.auth-switch {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 24px;
    text-align: center;
}

.auth-switch a {
    color: var(--google-blue);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Google Authentication UI
   ========================================================================== */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    width: 100%;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-neutral);
}

.auth-divider:not(:empty)::before {
    margin-right: 12px;
}

.auth-divider:not(:empty)::after {
    margin-left: 12px;
}

.btn-google-submit {
    width: 100%;
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-neutral);
    padding: 12px;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-google-submit:hover {
    background: #f8f9fa;
    border-color: #c4c7c5;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.btn-google-submit i {
    font-size: 1.15rem;
    color: #4285f4;
}

/* ==========================================================================
   Navigation User Stats & Credits Badges
   ========================================================================== */
.nav-user-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.credits-badge {
    background: #f1f3f4;
    border: 1px solid var(--border-neutral);
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.credits-badge:hover {
    background: var(--google-blue-bg);
    border-color: rgba(26, 115, 232, 0.25);
    color: var(--google-blue);
}

.credits-badge i {
    color: #f4b400;
    font-size: 1rem;
}

.pro-badge {
    background: linear-gradient(135deg, #a8c7fa 0%, #d3e3fd 100%);
    color: var(--google-blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(26, 115, 232, 0.2);
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.08);
}

/* ==========================================================================
   Studio Credits Status Dashboard
   ========================================================================== */
.studio-credits-dashboard {
    background: #ffffff;
    border: 1px solid var(--border-neutral);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.dashboard-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-metrics {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-badge-free {
    background: #f1f3f4;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-neutral);
}

.plan-badge-pro {
    background: var(--google-blue-bg);
    color: var(--google-blue);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(26, 115, 232, 0.2);
}

.btn-upgrade-pricing {
    background: linear-gradient(135deg, var(--google-blue) 0%, #1557b0 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-upgrade-pricing:hover {
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3);
    opacity: 0.95;
}

/* ==========================================================================
   Subscription Modals and Checkout Form
   ========================================================================== */
.subscription-card {
    max-width: 580px !important;
}

.sub-header {
    text-align: center;
    width: 100%;
    margin-bottom: 24px;
}

.plans-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    margin-bottom: 8px;
}

.plan-card {
    background: #ffffff;
    border: 1px solid var(--border-neutral);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
}

.plan-card.active {
    border-color: #c4c7c5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.plan-card.pro-card {
    border-color: var(--border-neutral);
    background: linear-gradient(180deg, rgba(232, 240, 254, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
}

.plan-card.pro-card.active-pro {
    border-color: var(--google-blue);
    box-shadow: 0 8px 24px rgba(26, 115, 232, 0.08);
}

.plan-badge-card {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--google-blue) 0%, #1557b0 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.plan-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.plan-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.plan-price span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.plan-features {
    list-style-type: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.plan-features li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

.plan-features li i {
    font-size: 1.05rem;
    color: var(--google-blue);
}

.text-gradient {
    background: var(--pixelai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-plan-action {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.btn-subscribe-trigger {
    background: var(--google-blue);
    color: white;
    border: none;
}

.btn-subscribe-trigger:hover {
    background: var(--google-blue-hover);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.25);
}

.btn-cancel-trigger {
    background: transparent;
    color: #db4437;
    border: 1px solid rgba(219, 68, 55, 0.3);
}

.btn-cancel-trigger:hover {
    background: rgba(219, 68, 55, 0.05);
    border-color: #db4437;
}

.active-plan {
    background: #f1f3f4;
    color: var(--text-muted);
    border: 1px solid var(--border-neutral);
    cursor: default;
}

/* Checkout View */
.checkout-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.checkout-back-btn {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: var(--google-blue);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.checkout-back-btn:hover {
    text-decoration: underline;
}

.checkout-view h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.checkout-price-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-checkout-submit {
    margin-top: 16px !important;
}

@media (max-width: 580px) {
    .plans-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==========================================================================
   Dark Mode variables override
   ========================================================================== */
body.dark-theme {
    --bg-primary: #0b0c10;
    --bg-secondary: #161920;
    --text-primary: #f1f3f5;
    --text-secondary: #9da5b4;
    --text-muted: #6c757d;
    --border-neutral: #2a2e3b;
    --google-blue-bg: #1e2638;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Hamburger Mobile Menu & Navigation Drawer
   ========================================================================== */
.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 4px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-menu-toggle:hover {
    background-color: var(--border-neutral);
}

.btn-menu-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
}

.btn-menu-close:hover {
    background-color: var(--border-neutral);
}

.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    transition: opacity 0.3s ease;
}

@media (max-width: 640px) {
    .btn-menu-toggle {
        display: flex;
    }

    .btn-menu-close {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background-color: var(--bg-secondary);
        z-index: 1000;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 80px 24px 40px;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 20px;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links .nav-link {
        font-size: 1.1rem;
        padding: 10px 14px;
        border-radius: var(--radius-sm);
        border-bottom: none !important;
    }

    .nav-links .nav-link.active {
        background-color: var(--google-blue-bg);
        color: var(--google-blue) !important;
    }

    .nav-links .nav-user-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin: 10px 0;
    }

    .nav-links .btn-auth-outline {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}

/* ==========================================================================
   Profile Section Styles
   ========================================================================== */
.profile-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-top: 16px;
    width: 100%;
}

.profile-sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex-shrink: 0;
}

.profile-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-card,
.theme-card,
.settings-card,
.history-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--pixelai-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.25rem;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.profile-card h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.theme-card h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.theme-switch-wrapper {
    display: flex;
    background-color: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
}

.btn-theme-toggle-chip {
    flex: 1;
    background: none;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-theme-toggle-chip:hover {
    color: var(--text-primary);
}

.btn-theme-toggle-chip.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.settings-card form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-heading {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.btn-update-submit {
    margin-top: 12px;
    max-width: 180px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-neutral);
    padding-bottom: 12px;
}

.history-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-clear-history {
    background: none;
    border: 1px solid var(--border-neutral);
    color: #db4437;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-clear-history:hover {
    background-color: #fdf2f2;
}

body.dark-theme .btn-clear-history:hover {
    background-color: #2c1d1d;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    min-height: 200px;
}

.history-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 60px 20px;
    text-align: center;
}

.history-empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
}

.history-item {
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--bg-primary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.history-img-box {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    background-color: var(--border-neutral);
}

.history-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    padding: 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.history-prompt {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-style {
    background-color: var(--border-neutral);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-transform: capitalize;
}

.history-actions {
    display: flex;
    border-top: 1px solid var(--border-neutral);
    background-color: var(--bg-secondary);
}

.btn-history-action {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-history-action:hover {
    color: var(--google-blue);
    background-color: var(--bg-primary);
}

.btn-history-action:first-child {
    border-right: 1px solid var(--border-neutral);
}

@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-sidebar {
        width: 100%;
    }
}

/* ==========================================================================
   New User Welcome Credits Popup Styling
   ========================================================================== */
.welcome-credits-card {
    text-align: center;
    max-width: 360px;
    padding: 32px;
}

.auto-close-progress-bar {
    width: 100%;
    height: 4px;
    background: #f1f3f4;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 24px;
    margin-bottom: 8px;
}

.progress-fill {
    width: 100%;
    height: 100%;
    background: var(--pixelai-gradient);
    transform-origin: left;
    animation: shrinkProgress 5s linear forwards;
}

@keyframes shrinkProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.auto-close-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}