/* How It Works & Interactive Simulator Section */
.how-works {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    position: relative;
}

.how-works-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
    align-items: center;
}

.how-works-text h3 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.how-works-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.stats-badge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-badge {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(245,158,11,0.1);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-badge-text span {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-badge-text label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .how-works-intro {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 480px) {
    .how-works-text h3 {
        font-size: 1.5rem;
    }
    .how-works-text p {
        font-size: 1rem;
    }
    .stats-badge-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .stat-badge {
        padding: 0.75rem;
    }
    .stat-badge-text span {
        font-size: 1rem;
    }
}

/* Interactive Simulator Styles */
.simulator-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-premium);
}

@media (max-width: 992px) {
    .simulator-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .phone-mockup {
        height: 400px;
        border-radius: 24px;
        border-width: 6px;
    }
    .phone-notch {
        width: 80px;
        height: 14px;
    }
    .tg-chat {
        padding: 0.75rem;
    }
    .tg-msg {
        max-width: 90%;
        font-size: 0.8rem;
    }
    .sqlite-mock {
        font-size: 0.75rem;
        padding: 1rem;
    }
    .sql-table th,
    .sql-table td {
        padding: 0.35rem;
        font-size: 0.7rem;
    }
    .simulator-grid {
        padding: 1rem;
        border-radius: 20px;
    }
    .console-header h4 {
        font-size: 1.25rem;
    }
    .console-header p {
        font-size: 0.85rem;
    }
    .sim-btn {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
}

/* Phone mockup for TG Bot */
.phone-mockup {
    background: #0f172a;
    border: 8px solid #1e293b;
    border-radius: 36px;
    height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    position: relative;
}

.phone-header {
    background: #1e293b;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.phone-notch {
    width: 100px;
    height: 18px;
    background: #0f172a;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    position: absolute;
    top: 0;
}

.tg-app {
    flex-grow: 1;
    background: #0e1621;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tg-navbar {
    background: #17212b;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #101921;
}

.tg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-darker);
    font-weight: 800;
    font-size: 0.9rem;
}

.tg-details {
    display: flex;
    flex-direction: column;
}

.tg-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.tg-status {
    font-size: 0.7rem;
    color: var(--primary-light);
}

.tg-chat {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-image: radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 16px 16px;
}

.tg-msg {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    animation: messagePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
}

.tg-msg.received {
    background: #182533;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.tg-msg.sent {
    background: #2b5278;
    color: var(--text-main);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.tg-msg img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: block;
}

.tg-msg-time {
    display: block;
    text-align: right;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.25rem;
}

.tg-footer {
    background: #17212b;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid #101921;
}

.tg-input {
    flex-grow: 1;
    background: #0e1621;
    border: 1px solid #243547;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tg-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2b5278;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

/* Simulator Console / SQLite Viewer */
.simulator-console {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.console-header {
    margin-bottom: 1.5rem;
}

.console-header h4 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.console-header h4 i {
    color: var(--primary-light);
}

.console-header p {
    font-size: 0.95rem;
}

.sqlite-mock {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.sql-query {
    color: #38bdf8;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}

.sql-table-wrapper {
    overflow-x: auto;
}

.sql-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.sql-table th {
    color: var(--text-muted);
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sql-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sql-table tr.new-row {
    animation: highlightRow 2s ease-in-out;
}

.sql-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sql-status.saved {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
}

.sql-status.parsing {
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary-light);
    animation: pulse 1s infinite alternate;
}

.sim-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sim-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--primary-light);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--bg-darker);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
    transition: var(--transition-smooth);
}

.sim-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
    background: #ffffff;
    color: var(--bg-darker);
    border-color: #ffffff;
}

.sim-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
