/* 
   Premium Dark Theme - Operator Scripts 
   Theme: Male Health, Confidence, Premium
   Colors: Slate 900/800, Emerald 500, Amber 500
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Manrope:wght@600;700;800&family=Montserrat:wght@700;800&display=swap');

:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    /* Same as main for seamless look, or slightly darker */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --accent-primary: #10b981;
    /* Emerald */
    --accent-glow: rgba(16, 185, 129, 0.3);
    --accent-secondary: #f59e0b;
    /* Gold/Amber */

    --font-heading: 'Manrope', sans-serif;
    --font-body: 'Inter', sans-serif;

    --sidebar-width: 300px;
    --header-height: 70px;
    --sp-section: 100px;
    --sp-card: 2rem;
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul,
ol {
    list-style: none;
    /* We will style them custom */
    padding-left: 0;
}

/* --- Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    background: var(--bg-sidebar);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    padding: 2rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 3px;
}

.logo-area {
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.logo-area img {
    max-width: 40px;
    margin-right: 10px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 2rem;
    max-width: 1400px;
    /* Limit width for readability on ultra-wide */
}

/* Products Navbar */
.products-navbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    transition: all 0.3s;
}

.product-card:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.product-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    white-space: normal;
    line-height: 1.15;
}

.product-link {
    padding: 0.3rem 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 3px;
    color: var(--accent-primary);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s;
    text-align: center;
    min-width: 35px;
}

.product-link:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: var(--accent-primary);
}

.product-link.ru-link {
    order: 1;
}

.product-link.kz-link {
    order: 2;
}

/* Header (Top Bar) */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    background: var(--bg-card);
}

.product-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.product-info span {
    margin-right: 1.2rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Content Sections */
section.content-section {
    margin-bottom: var(--sp-section);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.section-icon {
    width: 6px;
    height: 40px;
    background: var(--accent-primary);
    margin-right: 1rem;
    border-radius: 4px;
    box-shadow: 0 0 10pxVar(--accent-glow);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

/* Cards / Content Blocks */
.card-block {
    background: var(--bg-card);
    padding: var(--sp-card);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

/* Typography Details */
h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

h2:first-child {
    margin-top: 0;
}

h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    font-weight: 700;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Custom Lists (Checkmarks) */
.custom-list {
    margin: 1.5rem 0;
}

.custom-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.custom-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

.custom-list.ordered {
    counter-reset: my-counter;
}

.custom-list.ordered li {
    padding-left: 2.5rem;
}

.custom-list.ordered li::before {
    content: counter(my-counter);
    counter-increment: my-counter;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-secondary);
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
}

/* Green Checkmark specific replacement for old <ul> */
ul li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.8rem;
}

ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

ol li {
    list-style-type: decimal;
    margin-bottom: 0.8rem;
    margin-left: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Accordions */
.accordion {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.accordion-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.2s;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-header::after {
    content: "+";
    font-size: 1.5rem;
    color: var(--accent-primary);
    transition: transform 0.3s;
}

.accordion.active .accordion-header::after {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.1);
}

.accordion-content-inner {
    padding: 1.5rem;
}

/* Script Section */
.script-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.script-display {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 2rem;
    min-height: auto;
    order: 1;
}

.script-display h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--accent-primary);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.script-text {
    color: var(--text-secondary);
    line-height: 1.9;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.script-table-of-contents {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 8px;
    padding: 1rem;
    order: 4;
}

.toc-title {
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
}

.toc-item {
    padding: 0.5rem 0.8rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

.toc-item:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.toc-item.active {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.script-controls {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    order: 2;
}

.script-btn {
    padding: 0.9rem 2rem;
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-family: var(--font-body);
}

.script-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.start-btn {
    min-width: 160px;
}

.reset-btn {
    background: rgba(244, 63, 94, 0.1);
    border-color: #f43f5e;
    color: #f43f5e;
}

.reset-btn:hover {
    background: rgba(244, 63, 94, 0.2);
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
}

.script-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    order: 2;
}

.script-question {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid var(--accent-secondary);
    padding: 1.2rem;
    border-radius: 4px;
}

.script-question p {
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-weight: 500;
    font-family: var(--font-body);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.option-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.option-marker.positive {
    background-color: #10b981;
    /* Зелёный - позитивный */
}

.option-marker.negative {
    background-color: #ef4444;
    /* Красный - негативный */
}

.option-marker.neutral {
    background-color: #3b82f6;
    /* Синий - нейтральный */
}

.option-marker.other {
    background-color: #f1f5f9;
    /* Белый/светлый - другое */
}

.option-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    padding-left: 2rem;
}

.option-btn.other-option {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 1rem;
    padding: 0;
    background: transparent;
    border: none;
}

.option-btn.other-option .option-marker {
    padding: 1rem;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.option-btn.other-option span:not(.option-marker) {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-right: none;
}

.option-btn.other-option input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-left: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    padding: 1rem;
    border-radius: 0;
    font-family: var(--font-body);
}

.option-btn.other-option input::placeholder {
    color: var(--text-muted);
}

.option-btn.other-option input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.1);
}

.other-submit-btn {
    padding: 1rem 1.5rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-left: none;
    color: var(--accent-primary);
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.other-submit-btn:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--accent-primary);
}

.script-history {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 100px;
    overflow-y: auto;
    max-height: 500px;
    order: 3;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin: 0;
}

.history-clear-btn {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #f43f5e;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: #f43f5e;
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    font-size: 0.9rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 6px;
    border-left: 4px solid var(--accent-primary);
    line-height: 1.6;
}

.history-item .history-step {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}

.history-item .history-text {
    color: var(--text-secondary);
}

.history-item.client {
    border-left-color: var(--accent-secondary);
    background: rgba(245, 158, 11, 0.05);
}

.history-item.client .history-step {
    color: var(--accent-secondary);
}

/* Back to Top */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-primary);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 900;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
    border: none;
    font-size: 1.2rem;
}

#backToTop.show {
    opacity: 1;
    pointer-events: auto;
}

#backToTop:hover {
    transform: translateY(-5px);
    background: #34d399;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-right: 0;
        padding: 5rem 1rem 2rem 1rem;
        width: 100%;
        /* Ensure content doesn't overflow */
        overflow-x: hidden;
    }

    .mobile-toggle {
        display: flex;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .product-info span {
        display: block;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .products-navbar {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        padding: 1rem;
        gap: 0.6rem;
    }

    .product-card {
        padding: 0.6rem;
    }

    .product-name {
        font-size: 0.65rem;
    }

    .product-link {
        font-size: 0.65rem;
        min-width: 40px;
        padding: 0.3rem 0.5rem;
    }
}