/* 
   HDL2Chips Desktop Styles
   Breakpoint: min-width: 1025px
*/

/* 
   HDL2Chips Desktop Styles
   Breakpoint: min-width: 1025px
*/

main {
    padding-top: 48px;
    /* Absolute minimum space for navbar */
}

/* Hero Section */
.hero {
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 20px 40px;
    /* Minimized top padding */
    position: relative;
}



.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px;
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.highlight-primary {
    color: var(--primary);
}

.hero-subtext {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-start {
    background: var(--primary);
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
    background: #2563eb;
}

.btn-ai {
    background: transparent;
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-ai:hover {
    background: rgba(128, 128, 128, 0.05);
    border-color: var(--text-muted);
}

/* Code Preview Component */
.code-preview-container {
    width: 100%;
    max-width: 1000px; /* Slightly increased for better balance */
    margin: 20px auto 0;
    position: relative;
    z-index: 2;
}

.ide-window {
    background: #0d1117;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

.ide-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
}

.header-center {
    display: flex;
    justify-content: center;
    margin: 0 10px;
}

.rank-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.rank-badge {
    font-size: 0.6rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.05em;
}

.timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e293b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ide-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.ide-tabs {
    display: flex;
    gap: 24px;
    margin-left: 40px;
    position: relative;
}

.ide-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ide-tab.active {
    color: var(--text-muted);
    /* Darker for active in light header */
}

.tab-glider {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ide-status {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

/* AI Chat Styles */
.ai-chat-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.chat-message.user {
    align-self: flex-end;
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.chat-message.ai {
    align-self: flex-start;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    color: #e2e8f0;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.typewriter-text {
    border-right: 2px solid var(--primary);
    animation: blink-caret .75s step-end infinite;
    word-break: break-word;
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--primary);
    }
}

.ide-body {
    display: flex;
    height: 350px; /* Fixed small height */
}

.ide-sidebar {
    width: 40px;
    background: #f1f5f9;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
}

.sidebar-item {
    width: 100%;
    height: 110px;
    /* Optimal height for vertical text */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    color: #64748b;
    padding: 10px 0;
}

.sidebar-item::after {
    content: attr(title);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: capitalize;
}

.sidebar-item i {
    font-size: 1rem;
    display: none;
    /* Hide icons to match vertical text style if preferred, or keep small */
}

.sidebar-item.active {
    background: #fff;
    border-left-color: var(--primary);
    color: var(--primary);
}

.sidebar-item::after {
    content: attr(title);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.tab-content {
    display: none;
    flex: 1;
    /* Take remaining space */
}

.tab-content.active {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
}

#ai-tab.active {
    display: flex;
}

.ide-body {
    min-height: 360px;
}

.problem-pane {
    background: #fff;
    padding: 24px;
    text-align: left;
    border-right: 1px solid #f1f5f9;
    overflow-y: auto;
    /* Handle long content */
}

.problem-pane h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: #1e293b;
    font-weight: 700;
}

.problem-pane p {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 16px;
}

.io-examples {
    margin: 20px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.io-examples strong {
    font-size: 0.8rem;
    color: #1e293b;
    margin-bottom: 8px;
    display: block;
}

.io-examples pre {
    font-size: 0.75rem;
    color: #64748b;
    background: transparent;
    padding: 0;
    margin: 0;
}

.constraints-section {
    margin-top: 24px;
}

.constraints-section h4 {
    font-size: 0.9rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.constraints-section h4 i {
    color: var(--primary);
}

.constraints-section ul {
    list-style: none;
    padding: 0;
}

.constraints-section li {
    font-size: 0.8rem;
    color: #475569;
    padding: 4px 0 4px 20px;
    position: relative;
}

.constraints-section li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.pane-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.badge.easy {
    background: #eefdf3;
    color: #10b981;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.company-tags {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.editor-pane {
    background: #0d1117;
    padding: 20px;
    border-left: 1px solid var(--border);
    text-align: left;
    /* Forced left alignment */
}

.code-editor {
    display: flex;
    gap: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.line-numbers {
    display: flex;
    flex-direction: column;
    text-align: right;
    color: #4b5563;
    /* Muted gray for numbers */
    user-select: none;
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.editor-pane pre {
    margin: 0;
    padding: 0;
    color: #e6edf3;
}

/* Matched IDE Syntax Colors */
.keyword {
    color: #569cd6;
}

/* Blue keywords */
.comment {
    color: #6a9955;
}

/* Green comments */
.number {
    color: #b5cea8;
}

.text-dim {
    color: #9cdcfe;
}

/* Light blue for variables */

/* Bento Grid Features */
.features {
    padding: 40px 0;
    /* Much tighter */
    max-width: 900px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    /* Smaller header */
    margin-bottom: 8px;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 150px;
    /* High density */
    gap: 12px;
}

.card-icon {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.bento-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.bento-card p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Stats Row */
.stats-section {
    padding: 20px 0;
    margin-top: 30px;
    /* Added margin to separate from hero buttons */
}

.logo-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
    gap: 20px;
    /* Backup gap for expansion */
}

.logo-item {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    white-space: nowrap;
}

.logo-dot {
    font-size: 1rem;
    color: var(--primary);
    opacity: 0.8;
}

/* --- Domains Grid (Premium Divider Style) --- */
.domains-section {
    padding: 20px 0;
    /* Reduced padding */
    max-width: 1100px;
    margin: 0 auto;
    /* Removed extra top margin */
}

.domains-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 20px;
    position: relative;
}

/* Horizontal & Vertical Dividers using Borders */
.domain-card {
    padding: 16px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    text-align: left;
    /* Forced left alignment */
}

.domain-card:hover {
    background: rgba(128, 128, 128, 0.02);
}

.card-arrow {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-10px);
    margin-left: 8px;
    vertical-align: middle;
}

.domain-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Remove outer borders for the grid feel */
.domains-grid .domain-card:nth-child(3n) {
    border-right: none;
}

.domains-grid .domain-card:nth-child(n+4) {
    border-bottom: none;
}


/* Square Icon Boxes */
.domain-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* Category Specific Icon Colors */
.domain-card:nth-child(1) .domain-icon {
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
}

.domain-card:nth-child(2) .domain-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.domain-card:nth-child(3) .domain-icon {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.domain-card:nth-child(4) .domain-icon {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.domain-card:nth-child(5) .domain-icon {
    background: rgba(244, 114, 182, 0.1);
    color: #f472b6;
}

.domain-card:nth-child(6) .domain-icon {
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
}

.domain-card h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin: 0;
    font-weight: 600;
}

.domain-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
    max-width: 240px;
}

.problem-count {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
}

@media (max-width: 1024px) {
    .domains-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .domains-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Why LeetSilicon Section --- */
.why-section {
    padding: 60px 0 20px;
    margin-top: 20px;
    background: transparent;
    width: 100%;
    text-align: left;
}

.why-container {
    padding: 0 40px;
    margin-left: 0;
}

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

.why-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    align-items: flex-start;
}

.why-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.why-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
    margin: 0;
}

.why-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.why-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.why-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.why-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.why-item h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.why-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 1024px) {
    .why-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .why-title {
        font-size: 1.8rem;
    }
}

/* IDE Dark Mode Overrides - Universal Support */
:is(.dark-theme, .dark-mode, [data-theme="dark"]) .ide-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .problem-title {
    color: #f1f5f9;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .rank-timer {
    background: #0f172a;
    border-color: #334155;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .timer {
    color: #f1f5f9;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .problem-pane {
    background: #0f172a;
    border-right: 1px solid #1e293b;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .problem-pane h3 {
    color: #f1f5f9;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .problem-pane p {
    color: #94a3b8;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .ide-sidebar {
    background: #1e293b;
    border-right: 1px solid #334155;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .sidebar-item {
    color: #94a3b8;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .io-examples {
    background: #1e293b;
    border-color: #334155;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .io-examples pre {
    color: #cbd5e1;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .constraints-section h4 {
    color: #f1f5f9;
}

:is(.dark-theme, .dark-mode, [data-theme="dark"]) .constraints-section li {
    color: #94a3b8;
}