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

:root {
    --primary-color: #06b6d4;
    --secondary-color: #a855f7;
    --accent-color: #f59e0b;
    --text-color: #f8fafc;
    --text-light: #94a3b8;
    --bg-color: #0b0f19;
    --card-bg: rgba(15, 23, 42, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

body.light-theme {
    --primary-color: #0891b2;
    --secondary-color: #7c3aed;
    --accent-color: #d97706;
    --text-color: #0f172a;
    --text-light: #475569;
    --bg-color: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.4;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 40%),
                      radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.08) 0px, transparent 40%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Default locked viewport layout for large screens */
@media (min-width: 901px) and (min-height: 750px) {
    body {
        height: 100vh;
        overflow: hidden;
    }
    .container {
        height: 100vh;
    }
}

/* Header Section */
.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

body.light-theme .hero-title {
    color: #0f172a;
}

.hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Features Grid (5 columns) */
.features {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 1rem 0.75rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
}

/* Feature specific color themes */
.s3-card .feature-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.cf-card .feature-icon { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.tf-card .feature-icon { background: rgba(37, 99, 235, 0.15); color: #2563eb; }
.tfc-card .feature-icon { background: rgba(234, 88, 12, 0.15); color: #ea580c; }
.iac-card .feature-icon { background: rgba(219, 39, 119, 0.15); color: #db2777; }

.feature-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.feature-card p {
    font-size: 0.7rem;
    color: var(--text-light);
    line-height: 1.3;
}

/* Middle Layout Grid */
.content {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.demo-section, .info-section {
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.35rem;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.header-icon {
    width: 16px;
    height: 16px;
    color: var(--secondary-color);
}

.section-header h2 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color);
}

/* Demo Grid Layout */
.demo-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1.25rem;
    align-items: center;
    min-height: 0;
}

/* Terminal Simulator Box */
.terminal-box {
    background: #05070c;
    border-radius: 12px;
    height: 100%;
    min-height: 180px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.terminal-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}

.terminal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
    font-size: 0.6rem;
    color: var(--text-light);
    font-weight: 600;
    margin-left: 0.25rem;
}

.terminal-body {
    flex: 1;
    padding: 0.6rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    color: #e2e8f0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.term-line {
    margin: 0;
    line-height: 1.3;
}

.btn-deploy {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-deploy:hover:not(:disabled) {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-deploy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Demo Controls Column */
.demo-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    justify-content: center;
    min-width: 0;
}

/* Premium Button Overrides */
.demo-controls .btn {
    padding: 0.65rem 1rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
    outline: none !important;
}

.demo-controls .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: #ffffff !important;
    border: none !important;
}

.demo-controls .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3) !important;
    transform: translateY(-1px) !important;
}

.demo-controls .btn-secondary {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-color) !important;
}

body.light-theme .demo-controls .btn-secondary {
    background: rgba(0, 0, 0, 0.03) !important;
}

.demo-controls .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--primary-color) !important;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

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

/* Architecture Flow */
.arch-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
}

.arch-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 22%;
    min-width: 0;
}

.node-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.node-icon svg {
    width: 16px;
    height: 16px;
}

.arch-node:nth-child(1) .node-icon { color: var(--text-light); }
.arch-node:nth-child(3) .node-icon { color: #a855f7; }
.arch-node:nth-child(5) .node-icon { color: #10b981; }
.arch-node:nth-child(7) .node-icon { color: #6366f1; }

.arch-node span {
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.arch-node p {
    font-size: 0.6rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.arch-arrow-small {
    font-size: 1rem;
    color: var(--primary-color);
    opacity: 0.5;
}

.architecture-diagram-container {
    flex: 1;
    min-height: 0;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.arch-diagram-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Bottom Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.stat-card svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.stat-info h4 {
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-info p {
    font-size: 0.6rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer Section */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.65rem;
}

/* Responsive / scrollable layout for smaller screens */
@media (max-width: 900px) or (max-height: 749px) {
    body {
        height: auto;
        overflow-y: auto;
        padding: 1rem 0;
    }
    .container {
        height: auto;
        max-height: none;
        padding: 0.75rem;
        gap: 1.25rem;
    }
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
    .content {
        grid-template-columns: 1fr;
        height: auto;
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .features {
        grid-template-columns: 1fr;
    }
    .demo-grid {
        grid-template-columns: 1fr;
    }
    .stats-row {
        grid-template-columns: 1fr;
    }
}
