/* ==========================================================================
   Calesra IDE Premium Aesthetic - Index CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Color Palette (Cursor-inspired dark theme) */
    --bg-primary: #14120b;
    --bg-secondary: #1a1811;
    --bg-tertiary: #201e16;
    
    --text-primary: #edecec;
    --text-secondary: rgba(237, 236, 236, 0.55);
    --text-tertiary: rgba(237, 236, 236, 0.35);
    
    /* Borders & Accents */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.2);
    --glow-color: rgba(255, 255, 255, 0.15);
    --accent-blue: #3b82f6;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Effects */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary: #f0f0f1;
    
    --text-primary: #111827;
    --text-secondary: rgba(17, 24, 39, 0.65);
    --text-tertiary: rgba(17, 24, 39, 0.45);
    
    --border-subtle: rgba(0, 0, 0, 0.1);
    --border-highlight: rgba(0, 0, 0, 0.2);
    --glow-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .btn-secondary:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Global Transition for Smooth Theme Toggling */
body, .header, .spotlight-card, .footer-mega {
    transition: background-color var(--transition-smooth), color var(--transition-smooth), border-color var(--transition-smooth);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* ==========================================================================
   Header & Navigation (Glassmorphism)
   ========================================================================== */
.header {
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 100;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.logo-icon {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.logo-text {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Page Load Animation (Opacity only to prevent breaking position:fixed on header) */
@keyframes pageLoadFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

body {
    animation: pageLoadFadeIn 0.5s ease-out forwards;
}

.nav-links a:not(#nav-dashboard-btn):not(#nav-signin-btn) {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

.nav-links a:not(#nav-dashboard-btn):not(#nav-signin-btn):hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.nav-links a.active:not(#nav-dashboard-btn):not(#nav-signin-btn) {
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    max-width: 1000px;
    margin: 10rem auto 4rem;
    text-align: center;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Terminal / IDE Demo Animation */
.ide-demo-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 6rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-align: left;
    position: relative;
}

.ide-demo-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
    pointer-events: none;
}

.ide-header {
    height: 40px;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
}

.window-dots {
    display: flex;
    gap: 6px;
}

.window-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #333;
}

.ide-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 250px;
}

.code-line { margin-bottom: 0.5rem; }
.code-keyword { color: #c678dd; }
.code-function { color: #61afef; }
.code-string { color: #98c379; }
.code-comment { color: #5c6370; font-style: italic; }
.cursor-blink {
    display: inline-block;
    width: 8px;
    height: 15px;
    background-color: var(--text-primary);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   Bento Grid Pricing Section
   ========================================================================== */
.pricing-section {
    max-width: 1200px;
    margin: 0 auto 8rem;
    padding: 0 2rem;
}

.pricing-header {
    text-align: center;
    margin-bottom: 4rem;
}

.pricing-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    position: relative;
}

/* Spotlight Card Base */
.spotlight-card {
    position: relative;
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Spotlight Effect Magic */
.spotlight-card::before,
.spotlight-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    transition: opacity var(--transition-smooth);
    opacity: 0;
    pointer-events: none;
}

/* The gradient hover background on the card itself */
.spotlight-card::before {
    background: radial-gradient(
        600px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.04),
        transparent 40%
    );
    z-index: 1;
}

/* The glowing border effect */
.spotlight-card::after {
    padding: 1px; /* Border width */
    background: radial-gradient(
        400px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.3),
        transparent 40%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 2;
}

/* Static fallback border */
.spotlight-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.spotlight-card {
    border: 1px solid var(--border-subtle);
}

.spotlight-card:hover::before,
.spotlight-card:hover::after {
    opacity: 1;
}

.tier-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tier-price {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.price-period {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.tier-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    min-height: 40px;
}

.features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 3rem;
    flex-grow: 1;
}

.features-list li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.features-list li .check {
    color: var(--text-primary);
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==========================================================================
   Modals & States
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(20, 18, 11, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity var(--transition-smooth);
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition-smooth);
}

.modal-overlay.visible .modal {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.steps-box {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: left;
    margin-bottom: 2rem;
}

.steps-box ol {
    margin-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.steps-box strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Misc Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.full-height-center {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Pricing Pill Toggles
   ========================================================================== */
.pricing-pill-container {
    display: flex;
    background-color: var(--bg-primary);
    border-radius: 999px;
    padding: 4px;
    width: fit-content;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-subtle);
}

.pricing-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pricing-pill.active {
    background-color: var(--border-highlight);
    color: var(--text-primary);
}

.pricing-pill:hover:not(.active) {
    color: var(--text-primary);
}

/* ==========================================================================
   Massive Footer
   ========================================================================== */
.footer-mega {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    padding: 6rem 2rem 2rem;
    margin-top: 6rem;
}

.footer-mega-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 3rem;
    margin-bottom: 6rem;
}

.footer-col-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.footer-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-bottom-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Profile Dropdown Styles */
.profile-container {
    position: relative;
    display: inline-block;
}
.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.25rem 1rem 0.25rem 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
}
.profile-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-highlight);
}
.profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
}
.profile-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}
.pro-badge {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    min-width: 160px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 0.5rem 0;
}
.profile-container.active .profile-dropdown {
    display: block;
}
.profile-dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.profile-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.profile-dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.5rem 0;
}

/* Pricing Pill Toggles */
.pricing-pill-container {
    display: inline-flex;
    background: var(--bg-tertiary);
    border-radius: 999px;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-subtle);
}
.pricing-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.pricing-pill:hover {
    color: var(--text-primary);
}
.pricing-pill.active {
    background: var(--border-highlight);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Pricing Auth Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.steps-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.steps-box ol {
    margin-left: 1.2rem;
    color: var(--text-secondary);
}

.steps-box li {
    margin-bottom: 0.75rem;
}

.steps-box strong {
    color: var(--text-primary);
}

/* Responsiveness */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero { margin-top: 6rem; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 450px; margin: 0 auto; }
    .footer-mega-container { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
