:root {
    --primary: #5865F2;
    --primary-dark: #404eed;
    --text: #ffffff;
    --text-muted: #b9bbbe;
    --bg: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --white: #ffffff;
    --black: #000000;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.py-large {
    padding: 100px 0;
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(88, 101, 242, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--glass-border);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.1rem;
}

.btn-white {
    background: var(--white);
    color: var(--bg);
}

.btn-demo-highlight {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: var(--white);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Glassmorphism */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Header */
header {
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--text);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(88, 101, 242, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--primary);
}

#user-name-display {
    font-size: 0.9rem;
    font-weight: 600;
}

#logout-btn {
    color: var(--error);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 60px;
    min-height: 90vh;
    padding-top: 100px;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero-btns {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.hero-meta {
    display: flex;
    gap: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hero-meta i {
    color: var(--success);
}

/* UI Preview Mockup */
.main-ui-preview {
    padding: 0;
    overflow: hidden;
}

.ui-header {
    background: rgba(15, 23, 42, 0.8);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.dots {
    display: flex;
    gap: 6px;
}

.dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #475569;
}

.url-bar {
    background: #1e293b;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 6px;
    flex: 1;
    color: var(--text-muted);
    overflow: hidden;
    white-space: nowrap;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
}

.skeleton-img, .hero-img-slot {
    aspect-ratio: 1;
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    background-position: center;
    background-size: cover;
    transition: background-image 0.8s ease-in-out, opacity 0.5s ease;
}

.hero-img-slot.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0.5; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Web Tool Section */
.web-tool-section {
    background: radial-gradient(circle at top center, rgba(88, 101, 242, 0.1), transparent 70%);
}

.section-header {
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.badge {
    background: var(--primary);
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    vertical-align: middle;
}

.tool-container {
    max-width: 800px;
    margin: 0 auto;
}

.features-mini {
    display: flex;
    gap: 30px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.features-mini i {
    color: var(--primary);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.usage-warning {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.usage-warning a {
    color: inherit;
    font-weight: 700;
}

.input-group label {
    display: block;
    margin-bottom: 15px;
    font-weight: 500;
}

.url-input-wrapper {
    display: flex;
    gap: 15px;
}

.url-input-wrapper input {
    flex: 1;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    padding: 15px 20px;
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: 0.3s;
}

.url-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.1);
}

.tool-options {
    margin-top: 25px;
    display: flex;
    gap: 25px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tool-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Results Area */
.results-area {
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
}

.results-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    background: rgba(15, 23, 42, 0.4);
    padding: 15px 25px;
    border-radius: 10px;
}

.stat-item .label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.stat-item .value {
    font-weight: 700;
    color: var(--primary);
    margin-left: 5px;
}

.results-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.res-img-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: 0.2s;
}

.res-img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.res-img-card.selected {
    border-color: var(--primary);
}

.res-img-card .select-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    opacity: 0;
    transition: 0.2s;
}

.res-img-card.selected .select-overlay {
    opacity: 1;
    background: var(--primary);
}

.res-img-card .loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.res-img-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

/* Progress Area */
.progress-area {
    margin-top: 40px;
    background: rgba(15, 23, 42, 0.5);
    padding: 30px;
    border-radius: var(--radius);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.progress-bar-wrapper {
    height: 12px;
    background: #1e293b;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    width: 0%;
    transition: 0.3s;
}

.progress-details {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.download-log {
    background: #000000;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
    color: #10b981;
}

.done-message {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    border: 2px dashed var(--success);
    border-radius: var(--radius);
}

.done-message i {
    font-size: 2rem;
    color: var(--success);
    margin-bottom: 15px;
}

/* Debug Console */
.debug-console {
    margin-top: 40px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
}

.debug-console h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

#debug-log {
    font-family: monospace;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    padding: 40px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(88, 101, 242, 0.05);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 25px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-muted);
}

/* Pricing Refinement */
.pricing-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}

.tab-btn {
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Pricing Grid & Cards */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.price-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    position: relative;
    text-align: center;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.price-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.price-card.popular {
    border-color: var(--primary);
    transform: scale(1.05);
    background: rgba(88, 101, 242, 0.05);
    z-index: 10;
}

.price-card.popular:hover {
    transform: scale(1.05) translateY(-10px);
}

.price-card .badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-header h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: var(--text);
}

.price {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--white) 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.price span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.price-card p {
    color: var(--text-muted);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.credit-card {
    border: 1px solid rgba(88, 101, 242, 0.2);
}

.credit-card small {
    display: block;
    margin-top: 5px;
    margin-bottom: 25px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.py-medium {
    padding: 50px 0;
}

.demo-download-area {
    margin-top: 60px;
    border: 1px dashed var(--glass-border);
    padding: 40px;
    border-radius: var(--radius);
}

/* Footer Refinement */
.footer {
    border-top: 1px solid var(--glass-border);
    background: #0a0f1d;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 60px;
    padding-bottom: 40px;
}

.footer-brand .logo {
    margin-bottom: 20px;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
    margin-bottom: 25px;
}

.footer-copy {
    font-size: 0.8rem;
    color: #4b5563;
}

.footer-links-group {
    display: flex;
    gap: 80px;
}

.footer-col h4 {
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.3s;
}

.footer-col a:hover {
    color: var(--primary);
    padding-left: 5px;
}

/* Helpers */
.hidden {
    display: none !important;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    max-width: 400px;
    width: 100%;
    position: relative;
    padding: 40px;
}

.modal-content h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
}

.modal-content input {
    width: 100%;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text);
    margin-bottom: 15px;
    outline: none;
}

.modal-content p {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.w-full {
    width: 100%;
}

.download-group {
    display: flex;
    gap: 10px;
}

.bg-light {
    background: #0f172a88;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

@media (max-width: 968px) {
    nav {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
    }

    .logo {
        justify-content: center;
    }

    .nav-links {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .nav-links a {
        padding: 6px 10px;
    }

    .user-pill {
        margin-left: 0;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
        padding-top: 120px;
        min-height: auto;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero-btns {
        justify-content: center;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hero-btns .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-meta {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .results-stats {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    header {
        padding: 16px 0;
    }

    .hero h1 {
        font-size: 2.6rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    .main-ui-preview {
        margin-top: 10px;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 16px;
    }

    .url-input-wrapper {
        flex-direction: column;
    }

    .tool-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .features-mini {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .results-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .results-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .progress-info,
    .progress-details {
        flex-direction: column;
        gap: 12px;
    }

    .footer-links-group {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 540px) {
    body {
        font-size: 0.95rem;
    }

    .hero {
        gap: 30px;
    }

    .hero h1 {
        font-size: 2.3rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-btns {
        width: 100%;
    }

    .hero-image {
        max-width: 360px;
        margin: 0 auto;
    }

    .main-ui-preview {
        transform: scale(0.95);
        transform-origin: top center;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .glass-card {
        padding: 24px;
    }

    .tool-container {
        padding: 24px 16px;
    }

    .demo-download-area {
        padding: 24px;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 8px;
        flex-direction: column;
    }

    .nav-links a {
        width: 100%;
    }
}