/* ===== CSS Variables ===== */
:root {
    --primary: hsl(14, 83%, 60%);
    --primary-dark: hsl(14, 83%, 50%);
    --primary-light: hsl(14, 83%, 70%);
    --secondary: hsl(30, 20%, 96%);
    --text-dark: #555353;
    --text-light: hsl(15, 25%, 40%);
    --bg-light: hsl(30, 33%, 99%);
    --bg-white: hsl(0, 0%, 100%);
    --border: hsl(20, 15%, 90%);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Navigation ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-brand-company {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-brand-product {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.nav-cta {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all var(--transition);
}

.nav-links a.nav-cta:hover {
    background: var(--primary-dark);
    color: white;
}

/* ===== Hero Section ===== */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9f8 100%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-dark);
    margin-bottom: 24px;
    animation: slideInDown 0.8s ease-out;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 16px;
    animation: slideInUp 0.8s ease-out 0.1s both;
}

.hero-description {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.8;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.cta-button {
    display: inline-block;
    padding: 16px 40px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(32, 182, 158, 0.2);
    animation: slideInUp 0.8s ease-out 0.3s both;
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(32, 182, 158, 0.3);
}

.hero-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideInRight 0.8s ease-out;
}

.workflow-svg {
    width: 100%;
    max-width: 100%;
    height: auto;
}

.workflow-step {
    animation: fadeInScale 0.8s ease-out backwards;
}

.workflow-step.step-1 {
    animation-delay: 0s;
}

.workflow-step.step-2 {
    animation-delay: 1s;
}

.step-circle {
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    animation: drawCircle 0.8s ease-out backwards;
    transition: all var(--transition);
}

.workflow-step.step-1 .step-circle {
    animation-delay: 0.2s;
}

.workflow-step.step-2 .step-circle {
    animation-delay: 1.2s;
}

.workflow-step:hover .step-circle {
    filter: drop-shadow(0 8px 16px rgba(219, 80, 40, 0.3));
    stroke-width: 3;
}

.workflow-process {
    animation: fadeIn 0.8s ease-out 0.8s backwards;
}

.arrow-line {
    animation: drawLine 1s ease-out 0.8s backwards;
    stroke-dasharray: 140;
    stroke-dashoffset: 140;
}

.arrow-head {
    animation: fadeIn 0.4s ease-out 1.8s backwards;
}

.dot {
    animation: pulse 1.5s ease-in-out infinite;
}

.dot-1 {
    animation-delay: 1.2s;
}

.dot-2 {
    animation-delay: 1.4s;
}

.dot-3 {
    animation-delay: 1.6s;
}

.process-label {
    animation: fadeIn 0.6s ease-out 1s backwards;
}

/* ===== Features Section ===== */
.features {
    padding: 80px 0;
    background: var(--bg-white);
}

.section-title {
    font-size: 40px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.feature-card {
    padding: 32px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all var(--transition);
    animation: fadeInUp 0.6s ease-out backwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.feature-card:hover {
    background: var(--bg-white);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
    transition: transform var(--transition);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.feature-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ===== Chat Section ===== */
.chat-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9f8 100%);
}

.chat-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.chat-header-section {
    text-align: center;
    margin-bottom: 48px;
}

.chat-header-section h2 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.chat-header-section p {
    font-size: 16px;
    color: var(--text-light);
}

.chat-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 600px;
    animation: fadeIn 0.8s ease-out;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafbfc;
}

.chat-message {
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.4s ease-out;
}

.chat-message.user-message {
    align-items: flex-end;
}

.chat-message.bot-message {
    align-items: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    max-width: 70%;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Markdown styling inside message bubbles */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    font-weight: 700;
    margin: 12px 0 8px 0;
    line-height: 1.3;
}

.message-bubble h3 {
    font-size: 16px;
}

.message-bubble h4 {
    font-size: 15px;
}

.message-bubble p {
    margin: 8px 0;
}

.message-bubble strong,
.message-bubble b {
    font-weight: 700;
}

.message-bubble em,
.message-bubble i {
    font-style: italic;
}

.message-bubble ul,
.message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin: 4px 0;
}

.message-bubble a {
    text-decoration: underline;
    transition: opacity var(--transition);
}

.user-message .message-bubble a {
    color: rgba(255, 255, 255, 0.9);
}

.bot-message .message-bubble a {
    color: var(--primary);
}

.message-bubble a:hover {
    opacity: 0.8;
}

.message-bubble code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message-bubble pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
}

.message-bubble hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 12px 0;
}

.message-bubble blockquote {
    border-left: 3px solid rgba(0, 0, 0, 0.2);
    padding-left: 12px;
    margin: 8px 0;
    opacity: 0.8;
}

.user-message .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-bubble {
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
    padding: 0 4px;
}

.typing-indicator {
    display: none;
    padding: 16px 20px;
    align-items: center;
}

.typing-dots {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
    border: 1px solid var(--border);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
}

.chat-textarea {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    outline: none;
    transition: border-color var(--transition);
    color: var(--text-dark);
}

.chat-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(32, 182, 158, 0.1);
}

.chat-textarea::placeholder {
    color: var(--text-light);
}

.chat-send-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== Example Section ===== */
.example-section {
    padding: 80px 0;
    background: var(--bg-white);
}

.example-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.example-tab-btn {
    padding: 12px 24px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    transition: all var(--transition);
}

.example-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.example-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.example-tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.example-tab-content.active {
    display: block;
}

.section-subtitle {
    text-align: center;
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 60px;
}

.example-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: start;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9f8 100%);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid var(--border);
}

.example-input,
.example-output {
    flex: 1;
}

.example-label {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.example-content {
    background: var(--bg-white);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.input-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-light);
}

.input-item:last-child {
    border-bottom: none;
}

.input-item strong {
    color: var(--text-dark);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.example-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
}

.arrow-icon {
    font-size: 36px;
    color: var(--primary);
    opacity: 0.6;
}

.example-emails {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-white);
    transition: all var(--transition);
}

.email-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.email-toggle {
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition);
    font-size: 14px;
    text-align: left;
}

.email-toggle:hover {
    background: var(--bg-light);
}

.email-toggle.active {
    background: var(--bg-light);
}

.email-number {
    font-weight: 700;
    color: var(--text-dark);
    flex-shrink: 0;
}

.email-subject {
    font-size: 13px;
    color: var(--text-light);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toggle-icon {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.email-toggle.active .toggle-icon {
    transform: rotate(45deg);
}

.email-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
}

.email-body {
    padding: 0 16px 16px 16px;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
}

.email-body p {
    margin-bottom: 12px;
}

.email-body p:last-child {
    margin-bottom: 0;
}

.email-body ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.email-body li {
    margin-bottom: 6px;
}

/* ===== About Section ===== */
.about-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.about-header {
    text-align: center;
    margin-bottom: 60px;
}

.about-logo {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.about-header .section-title {
    color: var(--text-dark);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
    align-items: center;
}

.about-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-light);
}

.about-text p {
    margin-bottom: 20px;
}

.about-philosophy {
    font-size: 18px;
    color: var(--primary);
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.about-credentials {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.about-credentials h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.credentials-list {
    display: flex;
    flex-direction: row;
    gap: 40px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.credential-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.credential-logo {
    max-height: 70px;
    max-width: 120px;
    object-fit: contain;
    transition: all var(--transition);
    filter: brightness(0.9);
}

.credential-item:hover .credential-logo {
    filter: brightness(1);
    transform: scale(1.08);
}

.team-section {
    border-top: 2px solid var(--border);
    padding-top: 60px;
}

.team-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 50px;
    color: var(--text-dark);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.team-member {
    text-align: center;
    padding: 30px;
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.team-member:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

.team-photo {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
    display: block;
    transition: all var(--transition);
}

.team-member:hover .team-photo {
    transform: scale(1.02);
    filter: brightness(1.05);
}

.team-member h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.team-member p {
    font-size: 14px;
    color: var(--text-light);
}

/* ===== Footer ===== */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info h3,
.footer-links h3,
.footer-about h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.footer-info p,
.footer-about p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
}

.footer-info a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-info a:hover {
    color: var(--primary-light);
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== Animations ===== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes drawLine {
    from {
        stroke-dashoffset: 140;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
        r: 3px;
    }
    50% {
        opacity: 1;
        r: 5px;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes drawCircle {
    from {
        stroke-dashoffset: 314;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .section-title {
        font-size: 28px;
    }

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

    .nav-links {
        gap: 16px;
        font-size: 14px;
    }

    .hero,
    .features,
    .chat-section,
    .example-section,
    .about-section {
        padding: 60px 0;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    .footer-content {
        gap: 30px;
    }

    .feature-card {
        padding: 24px;
    }

    .example-container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px;
    }

    .example-arrow {
        transform: rotate(90deg);
        padding: 10px 0;
    }

    .email-toggle {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .email-number {
        margin-bottom: 8px;
    }

    .email-subject {
        font-size: 12px;
        white-space: normal;
        flex-basis: 100%;
        width: 100%;
        overflow: visible;
        text-overflow: clip;
    }

    .toggle-icon {
        align-self: flex-end;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .nav-brand h1 {
        font-size: 18px;
    }

    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-description {
        font-size: 14px;
    }

    .cta-button {
        padding: 12px 24px;
        font-size: 14px;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 40px;
    }

    .features-grid {
        gap: 16px;
    }

    .feature-card {
        padding: 16px;
    }

    .feature-icon {
        font-size: 36px;
    }
}
