/* ===================================
   Apex Digital - Chat Widget Styles
   =================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

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

/* Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--text-primary);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 1px;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

section {
    margin-bottom: 4rem;
}

/* Hero Section */
[data-semantic="hero"] {
    text-align: center;
    padding: 4rem 0;
}

/* Hero with Background Image */
.hero-with-bg {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('img/hero-kl-bg.jpg') center center / cover no-repeat;
    margin: -6rem -2rem 4rem -2rem;
    padding: 8rem 2rem 6rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(15, 23, 42, 0.7) 0%,
            rgba(15, 23, 42, 0.85) 50%,
            rgba(15, 23, 42, 0.95) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Service Icons */
.service-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: var(--transition);
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.service-icon-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.service-icon-gradient svg {
    width: 48px;
    height: 48px;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

/* Story Section with Team Photo */
.story-section {
    padding: 2rem 0;
}

.story-section h2 {
    text-align: left;
}

.story-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.story-text p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.story-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.story-image::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.team-photo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.story-image:hover .team-photo {
    transform: scale(1.03);
}

/* Services Page Hero */
.hero-services {
    background: url('img/services-hero-bg.jpg') center center / cover no-repeat;
}

/* Project Cards with Icons */
.project-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: var(--transition);
}

.project-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

.project-card:hover .project-icon {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

/* CTA with Background Image */
.cta-with-bg {
    position: relative;
    background: url('img/cta-bg.jpg') center center / cover no-repeat;
    padding: 5rem 2rem;
    margin: 0 -2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: center;
}

.cta-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(15, 23, 42, 0.85) 0%,
            rgba(99, 102, 241, 0.3) 100%);
    z-index: 1;
}

.cta-content {
    position: relative;
    z-index: 2;
}

.cta-content h2 {
    margin-bottom: 1rem;
}

.cta-content p {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.btn-lg {
    padding: 1.125rem 3rem;
    font-size: 1.1rem;
}

/* Testimonials Section */
.testimonials-section {
    padding: 3rem 0;
}

.testimonials-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.testimonials-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.client-photo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.testimonials-image:hover .client-photo {
    transform: scale(1.02);
}

.testimonials-quotes {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.testimonial-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
    margin: 0;
}

.testimonial-card p {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.testimonial-card cite {
    color: var(--primary-light);
    font-style: normal;
    font-weight: 500;
}

/* Location Section with Image */
.location-section {
    padding: 2rem 0;
}

.location-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
}

.location-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.office-photo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.location-image:hover .office-photo {
    transform: scale(1.02);
}

.location-text p {
    margin-bottom: 1rem;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.contact-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-lg);
}

.contact-detail {
    font-size: 0.9rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Branches Grid */
.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.branch-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hours Table */
.hours-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.hours-table .note {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--warning);
    font-size: 0.9rem;
}

/* Form Styles */
form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    .story-content,
    .testimonials-content,
    .location-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .story-section h2 {
        text-align: center;
    }

    .hero-with-bg {
        min-height: 70vh;
        margin: -5rem -1rem 2rem -1rem;
        padding: 6rem 1rem 4rem;
    }

    .cta-with-bg {
        padding: 3rem 1rem;
        margin: 0 -1rem;
    }

    .location-image {
        max-height: 250px;
        overflow: hidden;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
}

/* Cards & Grids */
.services-grid,
.values-grid,
.team-grid,
.culture-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.service-card,
.value-card,
.team-card,
.project-card,
.job-card,
.culture-card,
.process-step {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.service-card:hover,
.value-card:hover,
.team-card:hover,
.project-card:hover,
.job-card:hover,
.culture-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-lg);
}

/* Stats */
.stat-item {
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Lists */
ul {
    list-style: none;
    padding-left: 0;
}

.service-card ul,
.job-requirements {
    margin-top: 1rem;
}

.service-card li,
.job-requirements li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.service-card li::before,
.job-requirements li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Project Cards */
.project-type {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.project-highlights {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius);
}

.project-highlights li {
    color: var(--success);
    padding: 0.25rem 0;
}

.project-highlights li::before {
    content: '✓';
    color: var(--success);
}

.project-tech {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Job Cards */
.job-meta {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.job-salary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--success);
}

/* Team Cards */
.role {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

/* Process Steps */
.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    font-weight: 800;
    margin-bottom: 1rem;
}

/* Industries */
.industries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.industry-tag {
    padding: 0.5rem 1.5rem;
    background: var(--bg-card);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.industry-tag:hover {
    background: var(--primary);
    color: white;
}

/* Awards */
.awards-list {
    max-width: 600px;
    margin: 0 auto;
}

.awards-list li {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Benefits */
.benefits-list {
    max-width: 700px;
    margin: 0 auto;
}

.benefits-list li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
}

/* Jobs List */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Contact */
.contact-info {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 500px;
    margin: 0 auto;
}

/* Apply Section */
#apply {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.hiring-process {
    margin-top: 2rem;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.hiring-process ol {
    list-style: decimal;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.hiring-process li {
    padding: 0.5rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* ===================================
   Chat Widget Styles
   =================================== */

#apex-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Chat Toggle Button */
.apex-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.apex-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.7);
}

.apex-chat-toggle svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Chat Window */
.apex-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: var(--transition);
}

.apex-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.apex-chat-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.apex-chat-header .avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.apex-chat-header-text h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    background: none;
    -webkit-text-fill-color: white;
}

.apex-chat-header-text p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.apex-chat-header-text {
    flex: 1;
}

.apex-chat-header .apex-clear-btn {
    margin-left: auto;
    width: 32px;
    height: 32px;
}

/* Chat Messages */
.apex-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.apex-message {
    max-width: 85%;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.5;
}

.apex-message.bot {
    background: var(--bg-card);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.apex-message.user {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.apex-message.typing {
    display: flex;
    gap: 4px;
    padding: 1rem;
}

.apex-message.typing span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.apex-message.typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.apex-message.typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Source Attribution */
.apex-source {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.apex-source-url {
    display: block;
    margin-top: 0.25rem;
    color: var(--primary-light);
    text-decoration: none;
    cursor: pointer;
    word-break: break-all;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    transition: var(--transition);
}

.apex-source-url:hover {
    background: rgba(99, 102, 241, 0.2);
    text-decoration: none;
}

/* Bot Response Formatting */
.apex-message.bot p {
    margin: 0 0 0.5rem 0;
}

.apex-message.bot p:last-of-type {
    margin-bottom: 0;
}

.apex-message.bot strong {
    color: var(--primary-light);
    font-weight: 600;
}

.apex-response-list {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
    list-style-type: decimal;
}

.apex-response-list li {
    margin-bottom: 0.35rem;
    padding-left: 0.25rem;
    line-height: 1.5;
}

.apex-response-list li:last-child {
    margin-bottom: 0;
}

.apex-response-list li strong {
    color: var(--primary-light);
}

.apex-sub-item {
    margin: 0.25rem 0 0.25rem 0.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(99, 102, 241, 0.3);
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* Chat Input */
.apex-chat-input {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.75rem;
}

.apex-chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.apex-chat-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.apex-chat-input input::placeholder {
    color: var(--text-muted);
}

.apex-chat-input button {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.apex-chat-input button:hover:not(:disabled) {
    transform: scale(1.05);
}

.apex-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.apex-loading {
    text-align: center;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===================================
   Focus Mode Animations
   =================================== */

.apex-focus-highlight {
    animation: focusPulse 2s ease-in-out;
    position: relative;
}

.apex-focus-highlight::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    animation: focusBorder 2s ease-in-out;
    pointer-events: none;
}

@keyframes focusPulse {
    0% {
        background: rgba(99, 102, 241, 0);
    }

    25% {
        background: rgba(99, 102, 241, 0.2);
    }

    75% {
        background: rgba(99, 102, 241, 0.2);
    }

    100% {
        background: rgba(99, 102, 241, 0);
    }
}

@keyframes focusBorder {
    0% {
        opacity: 0;
        transform: scale(1.1);
    }

    25% {
        opacity: 1;
        transform: scale(1);
    }

    75% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.05);
    }
}

/* ===================================
   Side Panel Mode Styles
   =================================== */

/* Body shift when panel is open */
body.apex-panel-open {
    margin-right: 400px;
    transition: margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    transition: margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Side Panel Container */
.apex-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.apex-panel.open {
    transform: translateX(0);
}

/* Panel Header */
.apex-panel-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.apex-panel-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.apex-panel-header .avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.apex-panel-header-text h4 {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    background: none;
    -webkit-text-fill-color: white;
}

.apex-panel-header-text p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.apex-panel-header-text .status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.apex-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.apex-clear-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.7);
}

.apex-clear-btn:hover {
    background: rgba(244, 63, 94, 0.3);
    color: #f43f5e;
    transform: scale(1.05);
}

.apex-clear-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.apex-panel-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: white;
}

.apex-panel-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.apex-panel-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Panel Messages Area */
.apex-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Panel Input */
.apex-panel-input {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.5);
    flex-shrink: 0;
}

.apex-panel-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.apex-panel-input textarea {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: var(--transition);
    min-height: 48px;
    max-height: 120px;
}

.apex-panel-input textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.apex-panel-input textarea::placeholder {
    color: var(--text-muted);
}

.apex-panel-input button {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 48px;
}

.apex-panel-input button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.apex-panel-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.apex-panel-input button svg {
    width: 18px;
    height: 18px;
}

/* Panel Open Button (for when panel is closed) */
.apex-panel-trigger {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 48px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 9997;
    box-shadow: -4px 0 20px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
    color: white;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 1rem 0.5rem;
}

.apex-panel-trigger:hover {
    width: 56px;
    box-shadow: -6px 0 30px rgba(99, 102, 241, 0.6);
}

.apex-panel-trigger svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.apex-panel-trigger.hidden {
    transform: translateY(-50%) translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Mode Toggle Switch */
.apex-mode-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 6px;
    box-shadow: var(--shadow-lg);
}

.apex-mode-toggle button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
    background: transparent;
}

.apex-mode-toggle button.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.apex-mode-toggle button:not(.active) {
    color: var(--text-muted);
}

.apex-mode-toggle button:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.apex-mode-toggle-label {
    padding: 0 0.75rem 0 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
    }

    main {
        padding: 5rem 1rem 2rem;
    }

    .apex-chat-window {
        width: calc(100vw - 32px);
        right: -8px;
        bottom: 70px;
        height: 450px;
    }

    /* Side Panel Responsive - Overlay mode on mobile */
    body.apex-panel-open {
        margin-right: 0;
    }

    .apex-panel {
        width: 100%;
        max-width: 100vw;
    }

    .apex-panel-trigger {
        width: 44px;
        height: 100px;
        font-size: 0.75rem;
    }

    .apex-mode-toggle {
        bottom: 16px;
        left: 16px;
        padding: 4px;
    }

    .apex-mode-toggle button {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .apex-mode-toggle-label {
        display: none;
    }
}