/* src/style.css */
#premium-hero, #premium-hero * {
    box-sizing: border-box;
}

:root {
    --theme-primary: #00f0ff;
    --theme-secondary: #0a84ff;
    --theme-text: #e2e8f0;
    --theme-background: #050b14;
    --glass-bg: rgba(10, 15, 28, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-mono: Consolas, 'Courier New', monospace;
    --font-sans: 'Vazirmatn', 'Inter', 'Roboto', sans-serif;
}

/* -----------------------------------------------------------------------
   Container
   - height never exceeds 750px on any breakpoint (max-height guard)
   - min-height keeps it usable on very short viewports
   - overflow-y:auto is a safety net only; sizes below are tuned so
     content should fit without needing to scroll in normal cases
------------------------------------------------------------------------ */
#premium-hero {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 480px;
    max-height: min(750px, 100vh);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--theme-background);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-sans);
    color: var(--theme-text);
    padding: clamp(1rem, 3vw, 2rem) 5%;
    contain: layout paint;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

#premium-hero::-webkit-scrollbar {
    width: 6px;
}
#premium-hero::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

#hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-layout {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(1.5rem, 4vw, 4rem);
    max-width: 1200px;
    width: 100%;
    align-items: center;
}

@media (max-width: 992px) {
    .hero-layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: clamp(1rem, 3vh, 1.75rem);
    }
}

/* Left Side - Marketing Copy */
.hero-content h1 {
    font-size: clamp(1.5rem, 1.1rem + 2vw, 3rem);
    font-weight: 700;
    margin-bottom: clamp(0.5rem, 1.5vh, 1rem);
    background: linear-gradient(90deg, #fff, var(--theme-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero-content p {
    font-size: clamp(0.9rem, 0.8rem + 0.4vw, 1.125rem);
    color: #94a3b8;
    margin-bottom: clamp(0.75rem, 2vh, 2rem);
    line-height: 1.55;
    /* Prevent overly long descriptions from pushing height past budget */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-cta-btn {
    display: inline-block;
    padding: clamp(0.7rem, 1.5vh, 1rem) clamp(1.25rem, 3vw, 2rem);
    background: linear-gradient(135deg, var(--theme-secondary), var(--theme-primary));
    color: #fff;
    font-weight: 600;
    font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1rem);
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.4);
}

@media (hover: none) {
    /* Skip hover-lift on touch devices; avoids sticky-hover jank */
    .hero-cta-btn:hover {
        transform: none;
    }
}

/* Right Side - Terminal */
.hero-terminal-wrapper {
    perspective: 1000px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* The terminal only ever shows English (bash prompt, license keys,
   product specs). Some RTL themes/plugins apply `direction: rtl` (often
   with !important) to every element on the page, which overrides the
   dir="ltr" HTML attribute already set in the markup. This rule wins
   over that so the typing effect and text always run left-to-right. */
.hero-terminal-wrapper,
.hero-terminal-wrapper * {
    direction: ltr !important;
    unicode-bidi: plaintext;
}

.hero-terminal {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 240, 255, 0.08);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) rotateX(5deg);
    transition: opacity 0.8s ease, transform 0.8s ease, box-shadow 1s ease;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#premium-hero.terminal-visible .hero-terminal {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.hero-terminal.fading {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-terminal-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.hero-terminal-dots {
    display: flex;
    gap: 8px;
}

.hero-terminal-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.hero-terminal-title {
    font-size: 0.8rem;
    color: #64748b;
    letter-spacing: 1px;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.hero-terminal-body {
    padding: clamp(14px, 2.5vh, 24px) clamp(14px, 3vw, 24px);
    font-family: var(--font-mono);
    /* Fluid height instead of a hard 400px so the whole component
       always stays within the 750px cap, on every screen size */
    height: clamp(230px, 46vh, 400px);
    max-height: 400px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hero-product-info {
    display: none;
    flex-shrink: 0;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    animation: fadeInDown 0.5s ease forwards;
    text-align: left !important;
}

.hero-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.9rem);
}

.hero-info-label {
    color: #64748b;
}

.hero-info-value {
    color: var(--theme-primary);
    font-weight: 600;
}

.hero-console {
    flex: 1 1 auto;
    font-size: clamp(0.8rem, 0.75rem + 0.2vw, 0.95rem);
    line-height: 1.5;
    margin-bottom: 14px;
    overflow-y: auto;
    color: #cbd5e1;
    min-height: 0;
    text-align: left !important;
}

/* Custom Scrollbar for console */
.hero-console::-webkit-scrollbar {
    width: 6px;
}
.hero-console::-webkit-scrollbar-track {
    background: transparent;
}
.hero-console::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.hero-line { margin-bottom: 6px; }
.hero-line.hero-wait { color: #94a3b8; }
.hero-line.hero-success {
    color: #34d399;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.hero-cursor {
    display: inline-block;
    width: 8px;
    animation: blink 1s step-end infinite;
    color: var(--theme-primary);
}

.idle-cursor-line {
    opacity: 0.5;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-progress-container {
    flex-shrink: 0;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: clamp(14px, 2vh, 24px);
}

.hero-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--theme-secondary), var(--theme-primary));
    box-shadow: 0 0 15px var(--theme-primary);
    transition: width 0.3s ease;
}

.hero-license-key {
    flex-shrink: 0;
    text-align: center !important;
    font-size: clamp(0.85rem, 0.8rem + 0.3vw, 1.15rem);
    letter-spacing: 1.5px;
    color: var(--theme-primary);
    font-weight: bold;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
    min-height: 40px;
    word-break: break-all;
    background: rgba(0, 240, 255, 0.05);
    padding: 10px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 6px;
}

.hero-license-key.scan::after {
    content: "";
    position: absolute;
    top: 0;
    left: -30%;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: scan var(--scan-duration, 1.3s) linear;
}

@keyframes scan {
    to { left: 130%; }
}

.hero-verified {
    flex-shrink: 0;
    display: none;
    text-align: center !important;
    font-size: clamp(1.1rem, 1rem + 0.4vw, 1.5rem);
    color: #34d399;
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: 8px;
}

.hero-verified.animate-pop {
    animation: pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-activation-btn {
    display: inline-block;
    padding: clamp(0.5rem, 1.2vh, 0.6rem) clamp(1rem, 2.5vw, 1.5rem);
    background: transparent;
    color: var(--theme-primary);
    font-weight: 600;
    font-size: clamp(0.85rem, 0.8rem + 0.2vw, 1rem);
    border: 2px solid var(--theme-primary);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-activation-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

/* -----------------------------------------------------------------------
   Breakpoints
------------------------------------------------------------------------ */

/* Tablets / small laptops */
@media (max-width: 992px) {
    #premium-hero {
        min-height: 560px;
    }
    .hero-terminal-body {
        height: clamp(210px, 42vh, 340px);
    }
}

/* Large phones */
@media (max-width: 600px) {
    #premium-hero {
        padding: 1rem 5%;
        min-height: 520px;
    }
    .hero-terminal-body {
        height: clamp(190px, 38vh, 280px);
        padding: 12px 14px;
    }
    .hero-terminal {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
    }
    .hero-progress-container {
        margin-bottom: 12px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .hero-content p {
        -webkit-line-clamp: 3;
    }
    .hero-terminal-body {
        height: clamp(170px, 34vh, 240px);
    }
    .hero-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Short / landscape viewports: rely on the height cap + internal scroll */
@media (max-height: 620px) {
    #premium-hero {
        min-height: 420px;
        padding: 0.75rem 5%;
    }
    .hero-terminal-body {
        height: clamp(160px, 40vh, 260px);
    }
    .hero-content h1 {
        margin-bottom: 0.4rem;
    }
    .hero-content p {
        margin-bottom: 0.75rem;
        -webkit-line-clamp: 2;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .hero-terminal, .hero-cta-btn, .hero-verified.animate-pop {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
