:root {
    --navy: #2B2B3B;
    --gold: #BFB18A;
    --light-gold: #D4C4A8;
    --off-white: #F9F8F6;
    --subtle-gray: #E8E8E8;
    --text-dark: #2B2B3B;
    --light-blue: #E6EEF9;
    --medium-blue: #4A90E2;
    --dark-blue: #2C3E50;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced animated gradient background */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(circle at center,
        rgba(44, 62, 80, 0.98) 0%,
        rgba(43, 43, 59, 1) 100%);
}

/* Center glow effect */
.center-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(230, 238, 249, 0.05) 20%,
        rgba(74, 144, 226, 0.01) 40%,
        transparent 70%);
    z-index: 1;
    filter: blur(8px);
}

/* Line particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    background: linear-gradient(90deg,
        var(--particle-color-start) 0%,
        var(--particle-color-mid) 45%,
        transparent 80%);
    transform-origin: center;
    will-change: transform;
    opacity: 0;
    filter: blur(0.1px);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

/* Special handling for Samsung Browser on Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
    @supports (-webkit-appearance:none) and (display:flow-root) {
        .particle {
            background: -webkit-linear-gradient(90deg,
                var(--particle-color-start) 0%,
                var(--particle-color-mid) 45%,
                var(--particle-color-end, transparent) 80%);
            -webkit-filter: blur(0.1px);
            -webkit-transform-style: preserve-3d;
            transform-style: preserve-3d;
        }
    }
}

@keyframes particleMove {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scale(0);
        opacity: 0;
        width: 1.25px;
    }
    5% {
        opacity: 0.8;
        width: 2.5px;
    }
    30% {
        opacity: 0.6;
        width: 2px;
    }
    70% {
        opacity: 0.4;
        width: 1.5px;
    }
    100% {
        transform: translate(-50%, -50%) rotate(calc(var(--angle) + var(--rotation))) scale(var(--scale));
        opacity: 0;
        width: 1px;
    }
}

/* Special keyframes for Samsung Browser */
@supports (-webkit-appearance:none) and (display:flow-root) {
    @-webkit-keyframes particleMove {
        0% {
            -webkit-transform: translate(-50%, -50%) rotate(var(--angle)) scale(0);
            opacity: 0;
            width: 1.25px;
        }
        5% {
            opacity: 0.8;
            width: 2.5px;
        }
        30% {
            opacity: 0.6;
            width: 2px;
        }
        70% {
            opacity: 0.4;
            width: 1.5px;
        }
        100% {
            -webkit-transform: translate(-50%, -50%) rotate(calc(var(--angle) + var(--rotation))) scale(var(--scale));
            opacity: 0;
            width: 1px;
        }
    }
}

/* Main content needs to be above background */
.container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(80px + env(safe-area-inset-top)) 1.5rem 2rem;
    text-align: center;
}

.logo-section {
    display: none;
}

/* Header needs to be topmost */
.header {
    position: fixed;
    z-index: 1000;
    background: linear-gradient(to right,
        rgba(138, 43, 226, 0.2) 0%,
        rgba(148, 53, 236, 0.2) 50%,
        rgba(138, 43, 226, 0.2) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    top: env(safe-area-inset-top);
    left: 0;
    right: 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    height: 64px;
    padding-left: max(4rem, env(safe-area-inset-left));
    padding-right: max(4rem, env(safe-area-inset-right));
}

/* Base styles for larger screens */
.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 48px;
    font-weight: 500;
    letter-spacing: 0.02em;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    margin-top: -0.25rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.header img.logo {
    max-height: 50px;
    width: auto;
    margin: 0;
}

h1 {
    display: none;
}

.subtitle {
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    color: rgba(255, 255, 255, 0.92);
    font-size: 21px;
    font-weight: 400;
    letter-spacing: 0.007em;
    line-height: 1.4;
    opacity: 0.9;
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 0 1rem;
}

.subtitle::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--gold) 50%,
        transparent 100%
    );
    box-shadow: 0 0 8px var(--gold);
}

.subtitle-accent {
    display: block;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--gold);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Ensure preview container is above background */
.preview-container {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 0 40px rgba(74, 144, 226, 0.1);
    padding: 2rem;
    margin: 1.5rem auto;
    width: 100%;
    max-width: 800px;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: visible;
}

.preview-container:not([hidden]) {
    display: block;
}

/* Add hover effect when dragging over */
.preview-container[data-droppable="true"]:hover {
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.18),
        0 0 50px rgba(74, 144, 226, 0.15);
    transform: translateY(-2px);
}

/* Style for when dragging over */
.preview-container[data-droppable="true"] {
    position: relative;
}

.preview-container[data-droppable="true"]::after {
    content: "Drop to replace image";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(52, 152, 219, 0.95);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 99;
}

.preview-container[data-droppable="true"][style*="background-color"] {
    border: 2px dashed var(--medium-blue);
}

.preview-container[data-droppable="true"][style*="background-color"]::after {
    opacity: 1;
}

.preview-container[data-droppable="true"][style*="background-color"] img {
    filter: blur(4px) brightness(0.7);
    transition: all 0.3s ease;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 2rem;
    padding: 2rem 1rem;
}

/* Ensure upload container is above background */
.upload-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    margin: 1.5rem auto 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px dashed var(--subtle-gray);
    border-radius: 16px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 10px 15px rgba(0, 0, 0, 0.1),
        0 0 40px rgba(74, 144, 226, 0.1);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.upload-container::before {
    content: '';
    position: absolute;
    top: -25%;
    left: -25%;
    width: 150%;
    height: 150%;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 60%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.upload-container:hover {
    border-color: var(--medium-blue);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.04),
        0 15px 30px rgba(0, 0, 0, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.97);
}

.upload-container:hover::before {
    opacity: 0.6;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
    padding: 1rem 0;
}

.upload-content svg {
    width: 32px;
    height: 32px;
    color: var(--navy);
    opacity: 0.7;
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    margin-bottom: 0.5rem;
}

.upload-content p {
    margin: 0;
    line-height: 1.47059;
    font-size: 17px;
    color: var(--navy);
    font-weight: 400;
    letter-spacing: -0.022em;
}

.small {
    font-size: 14px;
    color: var(--text-dark);
    opacity: 0.8;
    margin-top: 0.5rem;
    letter-spacing: -0.016em;
}

#imagePreview {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Base styles for description area */
.description-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.description-container h2 {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    text-align: center;
    color: var(--navy);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 28px;
    letter-spacing: -0.021em;
}

.description-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section {
    margin-bottom: 2rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 1em 0 0.5em 0;
    color: #2c3e50;
}

.section-title:first-child {
    margin-top: 0;
}

.section-content {
    margin: 0.5em 0;
    line-height: 1.6;
}

.bullet {
    margin: 0.5em 0 0.25em 0;
    padding-left: 0.5em;
}

.sub-bullet {
    margin: 0.25em 0;
    padding-left: 2em;
    color: #555;
}

br {
    display: block;
    margin: 0.5em 0;
    content: "";
}

/* Ensure proper emoji alignment */
.section-title emoji {
    vertical-align: middle;
    margin-right: 0.5em;
}

/* Add some spacing between sections */
.section-title:not(:first-child) {
    margin-top: 1.5em;
}

/* Make sure bullets and sub-bullets are properly indented */
.bullet, .sub-bullet {
    display: block;
}

.bullet {
    font-weight: 500;
}

.sub-bullet {
    font-weight: normal;
}

/* Ensure proper spacing after bullet groups */
.bullet + br {
    margin-top: 1em;
}

/* Add some subtle hover effects */
.bullet:hover, .sub-bullet:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .description-text {
        font-size: 15px;
        padding: 1rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .section-content {
        font-size: 0.95rem;
    }
}

/* Add container for buttons to ensure proper alignment */
.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0 1rem;
}

.copy-button, .regenerate-button {
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.47059;
    letter-spacing: -0.022em;
    font-weight: 500;
    background: linear-gradient(135deg, var(--navy) 0%, var(--dark-blue) 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    text-transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    margin: 0.5rem !important;
    min-width: 200px !important;
    cursor: pointer !important;
}

.copy-button:hover, .regenerate-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--navy) 100%) !important;
}

/* Remove the different styling for regenerate button */
.regenerate-button {
    background: linear-gradient(135deg, var(--navy) 0%, var(--dark-blue) 100%) !important;
    color: white !important;
    border: none !important;
}

.regenerate-button:hover {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--navy) 100%) !important;
    color: white !important;
}

@media (max-width: 768px) {
    .container::before,
    .container::after {
        display: none;
    }
    
    .logo {
        max-width: 80%;
    }
    
    .upload-container {
        min-height: unset;
        height: 120px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .upload-content {
        margin: 0;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
    }

    .upload-content svg {
        width: 24px;
        height: 24px;
        margin: 0;
    }

    .upload-content p {
        font-size: 14px;
        margin: 0;
        line-height: 1.3;
    }

    .small {
        font-size: 12px;
        margin-top: 0.15rem;
    }

    .button-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    .copy-button, .regenerate-button {
        width: 100% !important;
        min-width: unset !important;
        margin: 0 !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
    }

    .copy-button {
        margin-bottom: 0.5rem !important;
    }

    .header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        height: 56px;
    }

    .header-title {
        font-size: 32px;
        letter-spacing: 0.015em;
    }

    .header img.logo {
        max-height: 40px;
    }

    .account-button {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

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

.loading-spinner p {
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    margin-top: 15px;
    color: var(--navy);
    font-size: 15px;
    letter-spacing: -0.016em;
    font-weight: 400;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nav {
    background: #1a1a1a;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.auth-button {
    background: #4285f4;
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 260px;
    margin-bottom: 1.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.auth-button i {
    font-size: 1.15rem;
}

.auth-button:hover {
    background: #357ae8;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.auth-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#signOutButton {
    background: none;
}

#signOutButton:hover {
    background-color: var(--off-white);
}

.auth-note {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1.5;
    max-width: 280px;
}

.auth-note i {
    color: #a8e6cf;
    font-size: 0.9rem;
    margin-right: 2px;
}

.auth-dot {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 4px;
    font-weight: bold;
}

/* Mobile responsiveness for auth container */
@media (max-width: 480px) {
    .auth-content {
        max-width: 340px;
    }
    
    .auth-container {
        padding: 2.5rem 1.8rem;
    }
    
    .auth-container h1 {
        font-size: 2.2rem;
    }
    
    .auth-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .auth-button {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
    
    .auth-message {
        font-size: 0.8rem;
        padding: 12px 15px;
        line-height: 1.5;
    }
    
    .auth-separator {
        margin: 0 5px;
        width: 3px;
        height: 3px;
    }
}

.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--navy) 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.auth-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.auth-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 3rem 2.5rem;
    border-radius: 1.2rem;
    backdrop-filter: blur(10px);
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out;
    margin-bottom: 1.5rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-container > * {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container h1 {
    color: var(--off-white);
    margin-bottom: 1rem;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--light-gold);
    margin-bottom: 2.5rem;
    font-size: 1.15rem;
    opacity: 0.95;
    line-height: 1.4;
    max-width: 280px;
}

.auth-note {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1.5;
    max-width: 280px;
}

.auth-note i {
    color: #a8e6cf;
    font-size: 0.9rem;
    margin-right: 2px;
}

.auth-dot {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 4px;
    font-weight: bold;
}

.auth-message {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    text-align: center;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    padding: 16px 22px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    margin-top: 0;
    width: 100%;
    animation: fadeIn 1s ease-out 0.3s both;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-message i {
    color: #a8e6cf;
    font-size: 1.1rem;
    margin-top: 2px;
}

.auth-message span {
    text-align: left;
}

.auth-separator {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    margin: 0 8px;
    position: relative;
    top: -3px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.main-content {
    min-height: 100vh;
    background: var(--off-white);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* When visible */
.main-content[style*="display: block"] {
    opacity: 1;
}

/* Profile Styles */
.profile-section,
.subscription-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--navy);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--subtle-gray);
    border-radius: 4px;
    font-size: 1rem;
}

.save-button {
    background: var(--navy);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.subscription-info,
.usage-info {
    margin-bottom: 2rem;
}

.subscription-info p,
.usage-info p {
    margin: 0.5rem 0;
}

.upgrade-button,
.renew-button {
    background: var(--gold);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 1rem;
}

.renew-button {
    background: var(--navy);
}

/* Active nav link */
.nav-link.active {
    color: var(--gold);
    font-weight: 500;
}

.sign-out {
    background-color: transparent;
    color: var(--navy);
    border: 1px solid var(--navy);
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sign-out:hover {
    background-color: var(--navy);
    color: white;
    transform: translateY(-1px);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.account-dropdown {
    position: relative;
    display: inline-block;
}

.account-button {
    background-color: var(--navy) !important;
    color: white !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.85rem !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
}

.account-button::after {
    content: none;
}

.account-button:hover {
    background-color: var(--dark-blue) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 220px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 0.5rem;
    border: 1px solid var(--subtle-gray);
}

.dropdown-content.show {
    display: block;
    animation: dropdownFade 0.2s ease-out;
}

.dropdown-label {
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.7;
    text-transform: uppercase;
}

.dropdown-separator {
    height: 1px;
    background-color: var(--subtle-gray);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--off-white);
}

.dropdown-shortcut {
    color: var(--text-dark);
    opacity: 0.5;
    font-size: 0.8rem;
}

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

/* Responsive typography adjustments */
@media (max-width: 1024px) {
    .header-title {
        font-size: 40px;
    }
    
    .subtitle {
        font-size: 19px;
        padding: 0 2rem;
    }
}

/* Keep ellipsis menu until more space is available */
@media (max-width: 1000px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .account-button {
        padding: 0 !important;
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        aspect-ratio: 1 !important;
    }

    .account-button::after {
        content: '☰';
        display: block;
        font-size: 18px;
        line-height: 1;
        width: 18px;
        height: 18px;
        text-align: center;
    }

    .account-button span {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-title {
        font-size: 32px;
        letter-spacing: 0.015em;
    }
    
    .subtitle {
        font-size: 17px;
        padding: 0 1.5rem;
        margin-bottom: 3rem;
    }

    .header img.logo {
        max-height: 40px;
    }
}

@media (max-width: 480px) {
    .header {
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
    }

    .header-title {
        font-size: 24px;
        letter-spacing: 0.01em;
        padding: 0 35px;
    }
    
    .subtitle {
        font-size: 16px;
        padding: 0 1rem;
        margin-bottom: 2.5rem;
    }

    .account-button {
        min-width: 32px !important;
        width: 32px !important;
        height: 32px !important;
    }
}

@media (max-width: 360px) {
    .header {
        padding: 0.75rem 0.25rem;
    }

    .header-title {
        font-size: 20px;
        letter-spacing: 0.005em;
        padding: 0 32px;
    }

    .account-button {
        padding: 0 !important;
        margin: 0 !important;
        min-width: 28px !important;
        width: 28px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        aspect-ratio: 1/1 !important;
        flex-shrink: 0 !important;
        box-sizing: content-box !important;
        overflow: hidden !important;
    }

    .account-button::after {
        content: '☰';
        width: 14px;
        height: 14px;
        font-size: 14px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Ensure minimum touch target sizes for mobile */
@media (max-width: 768px) {
    .dropdown-item,
    .auth-button {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Remove the min-height constraint for account-button */
    .account-button {
        min-height: unset;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .upload-container {
        padding: 0.75rem 0.5rem;
        margin: 0 0.5rem;
        height: 100px; /* Even smaller for portrait */
    }

    .upload-content {
        gap: 0.25rem; /* Reduce gap between elements */
    }

    .upload-content p {
        font-size: 13px; /* Slightly smaller font */
        line-height: 1.3;
    }

    .small {
        font-size: 11px;
        margin-top: 0.1rem;
    }
}

/* Handle extremely small screens */
@media (max-width: 360px) {
    .container {
        padding: 70px 1rem 1.5rem;
    }

    h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 16px;
    }

    .upload-content p {
        font-size: 14px;
    }
}

/* Improve loading spinner visibility on mobile */
@media (max-width: 768px) {
    .loading-spinner {
        margin: 15px 0;
    }

    .spinner {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }

    .loading-spinner p {
        font-size: 14px;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto; /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    max-height: 90vh; /* Maximum height relative to viewport */
    display: flex;
    flex-direction: column;
}

.modal-body {
    padding: 20px;
    overflow-y: auto; /* Enable scrolling for content */
    -webkit-overflow-scrolling: touch;
}

/* Mobile-specific modal adjustments */
@media (max-width: 768px) {
    .modal {
        align-items: flex-start; /* Start from top on mobile */
    }

    .modal-content {
        margin: 0 auto; /* Remove top margin on mobile */
        min-height: min-content; /* Allow content to determine height */
        max-height: 100%; /* Full height on mobile */
        border-radius: 0; /* Optional: full width on mobile */
    }

    .modal-body {
        max-height: calc(100vh - 120px); /* Account for header and padding */
    }

    .profile-info {
        padding-bottom: 20px; /* Add space at bottom for better scrolling */
    }
}

/* Ensure modal header stays fixed while scrolling */
.modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

/* Adjustments for narrow screens */
@media (max-width: 480px) {
    .description-container {
        padding: 0 0.5rem;
    }

    .description-text {
        padding: 1rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin: 1rem 0;
        font-size: 15px;
        line-height: 1.4;
        border-radius: 8px;
    }

    .preview-container {
        padding: 1rem 0.5rem;
        margin: 0 0.5rem 1rem;
    }

    main {
        padding: 1rem 0.5rem;
    }

    .description-container h2 {
        font-size: 22px;
        margin-bottom: 1rem;
    }

    .button-container {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .copy-button {
        margin-bottom: 0.75rem !important;
    }
}

/* Extra narrow screens */
@media (max-width: 360px) {
    .description-container {
        padding: 0 0.25rem;
    }

    .description-text {
        padding: 0.75rem;
        padding-left: 0.375rem;
        padding-right: 0.375rem;
        margin: 0.75rem 0;
    }

    .preview-container {
        padding: 0.75rem 0.25rem;
        margin: 0 0.25rem 0.75rem;
    }

    main {
        padding: 0.75rem 0.25rem;
    }
}

/* Landscape mode adjustments */
@media (orientation: landscape) and (max-width: 768px) {
    .button-container {
        flex-direction: row;
        gap: 1rem;
        padding: 0 1rem;
    }

    .copy-button, .regenerate-button {
        width: auto !important;
        min-width: 200px !important;
        margin: 0 !important;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .container {
        padding: 80px 0.75rem 1rem;
    }

    main {
        padding: 1rem 0.5rem;
    }

    .preview-container {
        padding: 1rem 0.5rem;
        margin: 0 0.5rem 1rem;
    }

    .upload-container {
        padding: 1.5rem 0.5rem;
        margin: 0 0.5rem;
    }

    .description-container {
        padding: 0 0.5rem;
    }

    .button-container {
        padding: 0 0.5rem;
    }
}

.dropdown-content a[id="billingButton"] {
    display: none;
}

/* Settings Modal Specific Styles */
.settings-section {
    padding: 1rem;
    border-bottom: 1px solid var(--subtle-gray);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 1rem;
    color: var(--navy);
    margin-bottom: 1rem;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.settings-label {
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* Color picker wrapper */
.color-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Range slider styling */
.settings-slider {
    -webkit-appearance: none;
    width: 150px;
    height: 4px;
    border-radius: 2px;
    background: var(--subtle-gray);
    outline: none;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--navy);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--subtle-gray);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--navy);
}

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

/* Reset button */
.reset-button {
    background: none;
    border: 1px solid var(--navy);
    color: var(--navy);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.reset-button:hover {
    background: var(--navy);
    color: white;
}

/* Reduce particle effects on smaller screens */
@media (max-width: 768px) {
    .particles {
        transform: scale(0.8); /* Slightly reduce overall scale */
    }
    
    .particle {
        filter: blur(0); /* Remove blur on mobile for better performance */
        -webkit-filter: blur(0);
    }
}

/* Mode badge styles */
.mode-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(44, 62, 80);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 100;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: help;
    pointer-events: auto;
}

.mode-badge:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mode-badge::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    border-width: 6px;
    margin-bottom: 5px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mode-badge::after {
    content: "Change defaults in Account→Settings";
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: max-content;
}

.mode-badge:hover::before,
.mode-badge:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Container positioning */
.upload-container,
.preview-container {
    position: relative;
    margin-top: 1.5rem;
}

/* Style for when dragging over */
.preview-container[data-droppable="true"] {
    position: relative;
}

.preview-container[data-droppable="true"]::after {
    content: "Drop to replace image";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(52, 152, 219, 0.95);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 99;
}

.preview-container[data-droppable="true"][style*="background-color"] {
    border: 2px dashed var(--medium-blue);
}

.preview-container[data-droppable="true"][style*="background-color"]::after {
    opacity: 1;
}

.preview-container[data-droppable="true"][style*="background-color"] img {
    filter: blur(4px) brightness(0.7);
    transition: all 0.3s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .mode-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
        top: -0.65rem;
    }
    
    .mode-badge::after {
        font-size: 0.7rem;
        padding: 6px 10px;
        white-space: nowrap;
        width: auto;
    }
    
    .mode-badge::before {
        border-width: 5px;
    }
}

/* Description text formatting */
.description-content {
    padding: 1.5rem;
    line-height: 1.6;
    color: #2c3e50;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.section-spacer {
    height: 1.5rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-content {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #34495e;
}

.bullet-container {
    margin: 0.5rem 0 1rem 0;
}

.bullet {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.sub-bullet-container {
    margin-left: 2rem;
}

.sub-bullet {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
    color: #576574;
    line-height: 1.5;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .description-content {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .bullet, .sub-bullet {
        padding-left: 1.25rem;
    }

    .sub-bullet-container {
        margin-left: 1.5rem;
    }
} 