@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #030305;
    --surface-color: #0F0F16;
    --surface-hover: #1A1A24;
    --primary-color: #6366F1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);
    --dashed-border: rgba(255, 255, 255, 0.2);
    --gradient-main: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
    --radius: 16px
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden
}

@media (max-width:768px) {
    body {
        font-size: 16px;
        overflow-x: hidden
    }
}

body.landing-page {
    overflow: auto;
    height: auto
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    max-width: 100vw;
    margin: 0 auto;
    overflow-x: hidden
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
    padding-bottom: 5rem;
    overflow: hidden;
    width: 100%
}

.inputs-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    min-width: 0;
    overflow: hidden
}

.input-card {
    flex: 1;
    background: transparent;
    border: 2px dashed var(--dashed-border);
    border-radius: var(--radius);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s;
    min-height: 0
}

.input-card.active .preview-img {
    display: block
}

.input-card.active .placeholder-content {
    display: none
}

.input-card:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05)
}

.card-header {
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center
}

.card-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer
}

.result-column {
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem
}

.result-card {
    flex: 3;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5)
}

.analysis-card {
    flex: 1;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 150px
}

.analysis-content {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-y: auto;
    white-space: pre-wrap;
    flex: 1;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.2);
    min-height: 0
}

.result-view {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center
}

#result-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none
}

.preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none
}

.card-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center
}

.file-upload-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10
}

.preview-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--surface-color);
    display: none;
    z-index: 5
}

.input-card.active .preview-img {
    display: block
}

.placeholder-content {
    text-align: center;
    color: var(--text-secondary);
    pointer-events: none
}

.placeholder-content i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5
}

.action-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    z-index: 100;
    background: linear-gradient(to top, var(--bg-color) 80%, transparent)
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex: 1;
    min-height: 0;
    padding-bottom: 5rem;
    overflow-y: auto
}

.btn-generate {
    background: var(--gradient-main);
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: pulse 2s infinite
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--primary-glow)
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4)
    }

    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0)
    }
}

.hidden {
    display: none !important
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 22, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem
}

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

.loading-text {
    color: white;
    font-weight: 600
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem
}

.download-group {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 10px;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.3s
}

.result-card:hover .download-group {
    opacity: 1
}

.action-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s
}

.action-btn:hover {
    background: var(--primary-color);
    border-color: transparent;
    transform: translateY(-2px)
}

.action-btn.premium {
    background: var(--gradient-main)
}

@media (max-width:576px) {
    .modal-content {
        max-width: 100%;
        margin: 10px
    }

    .modal-overlay {
        padding: 10px
    }

    .auth-card-premium {
        padding: 2.5rem 1.5rem;
        border-radius: 20px
    }

    .benefit-item {
        font-size: 1rem;
        gap: 0.8rem;
        margin-bottom: 1.5rem
    }

    .benefit-item i {
        font-size: 1.3rem
    }

    .google-signin-btn {
        font-size: 1.1rem;
        padding: 1rem;
        font-weight: 700
    }

    .auth-footer-links {
        font-size: 1rem
    }
}

@media (max-width:768px) {
    .app-container {
        padding: 15px;
        height: auto;
        min-height: 100vh;
        overflow-y: auto
    }

    .app-header {
        margin-bottom: 2rem;
        padding-top: 20px
    }

    .app-title {
        font-size: 1.6rem;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px
    }

    .app-subtitle {
        font-size: 1rem;
        line-height: 1.6;
        text-align: center;
        padding: 0 10px
    }

    .token-badge {
        margin-left: 0;
        font-size: 1rem;
        padding: 8px 16px
    }

    .main-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        display: flex;
        flex-direction: column;
        padding-bottom: 6rem
    }

    .inputs-row {
        gap: 1rem;
        height: auto
    }

    .input-card {
        height: 350px
    }

    .card-header {
        font-size: 1.1rem;
        padding: 12px 15px
    }

    .placeholder-content i {
        font-size: 3rem
    }

    .placeholder-content p {
        font-size: 1.1rem
    }

    .result-column {
        height: auto;
        gap: 1.5rem
    }

    .result-card {
        min-height: 400px
    }

    .analysis-card {
        min-height: 200px
    }

    .action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 1rem;
        background: linear-gradient(to top, var(--bg-color) 70%, transparent);
        z-index: 1000
    }

    .btn-generate {
        width: 100%;
        padding: 1.2rem;
        font-size: 1.2rem;
        justify-content: center
    }
}

@media (max-width:480px) {
    .auth-card-premium {
        padding: 1.5rem
    }

    .benefit-item {
        font-size: 0.95rem
    }
}

.auth-page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent), radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent)
}

.auth-card-premium {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5)
}

.benefits-list {
    list-style: none;
    margin-bottom: 2.5rem
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary)
}

.benefit-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center
}

.google-signin-btn {
    width: 100%;
    background: #6366F1;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.3s;
    text-decoration: none
}

.google-signin-btn:hover {
    background: #4F46E5;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3)
}

.google-logo-wrapper {
    background: white;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px
}

.google-logo-wrapper img {
    width: 18px;
    height: 18px
}

.auth-footer-links {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem
}

.auth-footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600
}

.auth-footer-links a:hover {
    text-decoration: underline
}

.token-badge {
    background: var(--gradient-main);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 0.5rem
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 3, 5, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    overflow-y: auto
}

.modal-overlay.active {
    display: flex
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    animation: modalFadeIn 0.3s ease-out
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95)
    }

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

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2010;
    transition: all 0.3s
}

.close-modal:hover {
    color: white;
    transform: rotate(90deg)
}

.modal-content .auth-card-premium {
    max-width: 100%;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.1)
}