/* ===================================
   TECOTEC Brand Playbook Stylesheet
   Version 2.0 — tecotec-mkt
   =================================== */

/* CSS Variables - Brand Colors */
:root {
    --orange-primary: #FF9900;
    --blue-secondary: #146EB4;
    --off-white-bg: #F4F6F8;
    --text-dark: #1a1a1a;
    --text-gray: #666666;
    --text-light: #999999;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --line-height-base: 1.6;
    --line-height-heading: 1.3;

    /* Layout */
    --toc-width: 300px;
    --max-content-width: 900px;
    --header-height: 70px;
}

/* ===================================
   Reset & Base Styles
   =================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height-base);
    color: var(--text-dark);
    background-color: var(--off-white-bg);
    overflow-x: hidden;
}

/* ===================================
   Typography
   =================================== */

h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-heading);
    font-weight: 600;
    color: var(--blue-secondary);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    margin-top: var(--spacing-xl);
}

h3 {
    font-size: 1.5rem;
    margin-top: var(--spacing-lg);
}

h4 {
    font-size: 1.25rem;
    margin-top: var(--spacing-md);
}

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--blue-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--orange-primary);
}

strong {
    font-weight: 600;
    color: var(--text-dark);
}

/* ===================================
   Layout
   =================================== */

body {
    display: grid;
    grid-template-columns: var(--toc-width) 1fr;
    min-height: 100vh;
}

/* ===================================
   Reading Progress Bar (NEW)
   =================================== */

.reading-progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--border-color);
    z-index: 110;
}

.reading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--orange-primary), #ff7700);
    transition: width 0.15s ease-out;
    border-radius: 0 2px 2px 0;
}

/* ===================================
   Table of Contents (Sidebar)
   =================================== */

.toc {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--toc-width);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: var(--spacing-lg);
    z-index: 100;
    box-shadow: 2px 0 8px var(--shadow-light);
}

.toc-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--orange-primary);
}

.toc-logo {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-bottom: var(--spacing-md);
}

.toc h2 {
    font-size: 1.25rem;
    color: var(--blue-secondary);
    margin: 0;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: var(--spacing-xs);
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--text-gray);
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.toc-link:hover {
    background-color: var(--off-white-bg);
    color: var(--blue-secondary);
    padding-left: var(--spacing-md);
}

.toc-link.active {
    background-color: var(--orange-primary);
    color: var(--white);
    font-weight: 600;
}

.toc-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--off-white-bg);
    color: var(--blue-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.toc-link.active .toc-number {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
}

/* ===================================
   Mobile Menu
   =================================== */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: var(--spacing-md);
    left: var(--spacing-md);
    z-index: 200;
    background: var(--orange-primary);
    border: none;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px var(--shadow-medium);
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* ===================================
   Main Content
   =================================== */

.main-content {
    grid-column: 2;
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    width: 100%;
}

/* ===================================
   Hero Section
   =================================== */

.hero {
    background: linear-gradient(135deg, var(--blue-secondary) 0%, #0d5a8f 50%, #0a4670 100%);
    background-size: 200% 200%;
    animation: heroGradient 8s ease infinite;
    color: var(--white);
    padding: var(--spacing-xl) var(--spacing-lg);
    border-radius: 12px;
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 8px 24px var(--shadow-medium);
    text-align: center;
}

@keyframes heroGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: var(--spacing-md);
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero-title .subtitle {
    display: block;
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: var(--spacing-sm);
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.hero-tagline {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--orange-primary);
    font-style: italic;
    margin-top: var(--spacing-md);
}

/* ===================================
   Content Sections
   =================================== */

.content-section {
    background: var(--white);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: box-shadow 0.3s ease;
}

.content-section:hover {
    box-shadow: 0 4px 16px var(--shadow-medium);
}

.section-title {
    color: var(--orange-primary);
    font-size: 2rem;
    font-weight: 700;
    padding-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--orange-primary);
    margin-bottom: var(--spacing-lg);
}

.subsection {
    margin-bottom: var(--spacing-lg);
}

/* ===================================
   Fade-in Animation (NEW)
   =================================== */

.content-section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease;
}

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

/* Hero doesn't need fade-in */
.hero {
    opacity: 1;
    transform: none;
}

/* ===================================
   Callout Boxes
   =================================== */

.callout {
    background: var(--off-white-bg);
    border-left: 4px solid var(--blue-secondary);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    border-radius: 4px;
}

.callout h3 {
    color: var(--blue-secondary);
    margin-top: 0;
    font-size: 1.25rem;
}

.callout.warning {
    border-left-color: var(--orange-primary);
    background: #fff8f0;
}

.callout.error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

/* ===================================
   Lists
   =================================== */

ul, ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

ul li, ol li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.7;
}

.checklist {
    list-style: none;
    margin-left: 0;
}

.checklist li {
    padding-left: var(--spacing-lg);
    position: relative;
    margin-bottom: var(--spacing-sm);
}

.checklist li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--orange-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.checklist.error li::before {
    content: "\2717";
    color: #dc3545;
}

/* ===================================
   Tables
   =================================== */

.table-responsive {
    overflow-x: auto;
    margin: var(--spacing-md) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-light);
}

thead {
    background: var(--blue-secondary);
    color: var(--white);
}

th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

tbody tr:nth-child(even) {
    background-color: var(--off-white-bg);
}

tbody tr:hover {
    background-color: #fff8f0;
}

/* ===================================
   Cards & Grids
   =================================== */

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.value-card {
    background: var(--off-white-bg);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-top: 4px solid var(--orange-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px var(--shadow-medium);
}

.value-card h4 {
    color: var(--orange-primary);
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
}

.value-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-gray);
}

/* ===================================
   Color Palette
   =================================== */

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.color-swatch {
    text-align: center;
}

.color-box {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 4px 12px var(--shadow-medium);
    transition: transform 0.3s ease;
}

.color-swatch:hover .color-box {
    transform: scale(1.03);
}

.color-swatch h4 {
    font-size: 1rem;
    margin: var(--spacing-sm) 0;
    color: var(--blue-secondary);
}

.color-swatch p {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin: var(--spacing-xs) 0;
}

/* Click-to-copy color HEX (NEW) */
.color-hex {
    cursor: pointer;
    position: relative;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.color-hex:hover {
    background-color: var(--off-white-bg);
}

/* ===================================
   Copy Tooltip (NEW)
   =================================== */

.copy-tooltip {
    position: fixed;
    background: var(--text-dark);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1000;
}

.copy-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Logo Container
   =================================== */

.logo-container {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--white);
    border-radius: 8px;
    margin: var(--spacing-lg) 0;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.brand-logo {
    max-width: 300px;
    height: auto;
}

/* ===================================
   Logo Download Grid (NEW)
   =================================== */

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.download-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--off-white-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    cursor: pointer;
}

.download-card:hover {
    border-color: var(--orange-primary);
    background: var(--white);
    box-shadow: 0 6px 20px var(--shadow-medium);
    transform: translateY(-4px);
    color: var(--text-dark);
}

.download-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
}

.download-icon svg {
    width: 100%;
    height: 100%;
}

.download-info {
    flex: 1;
    min-width: 0;
}

.download-info h4 {
    margin: 0 0 2px 0;
    font-size: 1.1rem;
    color: var(--blue-secondary);
}

.download-desc {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin: 0 0 2px 0;
}

.download-size {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--orange-primary);
    color: var(--white);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.download-card:hover .download-btn {
    background: #e68a00;
}

/* ===================================
   Personality Traits
   =================================== */

.personality-trait {
    background: var(--off-white-bg);
    padding: var(--spacing-md);
    border-radius: 8px;
    margin-bottom: var(--spacing-md);
    border-left: 4px solid var(--orange-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.personality-trait:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 12px var(--shadow-light);
}

.personality-trait h4 {
    color: var(--orange-primary);
    margin-top: 0;
}

.example {
    font-style: italic;
    color: var(--text-gray);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--white);
    border-radius: 4px;
}

/* ===================================
   Do's & Don'ts
   =================================== */

.dos-donts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.dos-section, .donts-section {
    background: var(--off-white-bg);
    padding: var(--spacing-lg);
    border-radius: 8px;
}

.dos-title {
    color: #28a745;
    border-bottom: 3px solid #28a745;
    padding-bottom: var(--spacing-sm);
}

.donts-title {
    color: #dc3545;
    border-bottom: 3px solid #dc3545;
    padding-bottom: var(--spacing-sm);
}

/* ===================================
   Example Boxes
   =================================== */

.example-box {
    padding: var(--spacing-md);
    border-radius: 8px;
    margin: var(--spacing-md) 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.example-box.correct {
    background: #f0f9f4;
    border: 2px solid #28a745;
}

.example-box.incorrect {
    background: #fff5f5;
    border: 2px solid #dc3545;
}

/* ===================================
   Highlight Elements
   =================================== */

.highlight {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--orange-primary);
    text-align: center;
    padding: var(--spacing-md);
    background: var(--off-white-bg);
    border-radius: 8px;
    margin: var(--spacing-md) 0;
}

.highlight-box {
    background: linear-gradient(135deg, var(--orange-primary) 0%, #ff7700 100%);
    color: var(--white);
    padding: var(--spacing-lg);
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
    margin: var(--spacing-lg) 0;
}

.highlight-box p {
    margin: 0;
}

/* ===================================
   Personality Tags
   =================================== */

.personality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.tag {
    background: var(--blue-secondary);
    color: var(--white);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px var(--shadow-medium);
}

/* ===================================
   Quick Colors
   =================================== */

.quick-colors {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin: var(--spacing-md) 0;
}

.quick-color {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.color-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 8px var(--shadow-medium);
}

/* ===================================
   Footer
   =================================== */

.footer {
    background: var(--blue-secondary);
    color: var(--white);
    padding: var(--spacing-xl);
    text-align: center;
    margin-top: var(--spacing-xl);
    border-radius: 8px;
}

.footer-content p {
    margin: var(--spacing-xs) 0;
}

.footer a {
    color: var(--orange-primary);
    font-weight: 600;
}

.footer a:hover {
    color: var(--white);
}

/* ===================================
   Back to Top Button
   =================================== */

.back-to-top {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    background: var(--orange-primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 80;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--blue-secondary);
    transform: translateY(-4px);
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    .toc,
    .mobile-menu-toggle,
    .back-to-top,
    .mobile-overlay,
    .reading-progress-container,
    .copy-tooltip {
        display: none !important;
    }

    body {
        grid-template-columns: 1fr;
    }

    .main-content {
        max-width: 100%;
        padding: 0;
    }

    .content-section {
        page-break-inside: avoid;
        box-shadow: none;
        opacity: 1;
        transform: none;
    }

    a {
        color: var(--text-dark);
        text-decoration: underline;
    }
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {
    :root {
        --toc-width: 250px;
        --max-content-width: 700px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .download-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile (< 768px) */
@media screen and (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .toc {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }

    .toc.active {
        transform: translateX(0);
    }

    .mobile-overlay.active {
        display: block;
    }

    .main-content {
        grid-column: 1;
        padding: var(--spacing-md);
        padding-top: 80px;
    }

    .hero {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-title .subtitle {
        font-size: 1.25rem;
    }

    .hero-logo {
        max-width: 120px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .content-section {
        padding: var(--spacing-md);
    }

    .values-grid,
    .color-palette,
    .dos-donts-grid,
    .download-grid {
        grid-template-columns: 1fr;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    th, td {
        padding: var(--spacing-sm);
    }

    .back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 48px;
        height: 48px;
    }

    .download-card {
        flex-wrap: wrap;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
        padding: 8px;
    }
}

/* Small Mobile (< 480px) */
@media screen and (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .content-section {
        padding: var(--spacing-sm);
    }

    .personality-tags {
        flex-direction: column;
    }

    .tag {
        text-align: center;
    }
}

/* ===================================
   Accessibility
   =================================== */

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 3px solid var(--orange-primary);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .content-section {
        opacity: 1;
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-dark: #000000;
        --text-gray: #4a4a4a;
        --border-color: #000000;
    }

    .callout,
    .value-card,
    .personality-trait {
        border: 2px solid var(--text-dark);
    }
}
