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

:root {
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --bg-white: #ffffff;
    --bg-gray: #f5f5f7;
    --border-color: #d2d2d7;
    --link-color: #0071e3;
    --link-hover: #0077ed;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.logo {
    font-size: 21px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.011em;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 17px;
    font-weight: 400;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-title {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin-bottom: 40px;
    line-height: 1.07143;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
    border-color: var(--link-color);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 12px;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 17px;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.clear-search {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.clear-search:hover {
    color: var(--text-primary);
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 8px;
    padding: 8px 0;
    box-shadow: var(--shadow);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.search-result-item:hover {
    background-color: var(--bg-gray);
}

/* Quick Links */
.quick-links {
    padding: 60px 0;
    background: var(--bg-gray);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.link-card {
    background: var(--bg-white);
    padding: 40px 30px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.link-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.link-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.011em;
}

.link-card p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.47059;
}

/* FAQ Section */
.faq-section {
    padding: 80px 0;
}

.section-title {
    font-size: 48px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 50px;
    letter-spacing: -0.005em;
    line-height: 1.08349;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

.faq-item:first-child {
    border-top: 1px solid var(--border-color);
}

.faq-question {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 21px;
    font-weight: 400;
    color: var(--text-primary);
    padding: 0;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 28px;
    color: var(--text-secondary);
    font-weight: 300;
    transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
    content: '−';
}

.faq-answer {
    margin-top: 16px;
    padding-left: 0;
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.47059;
}

.faq-answer p {
    margin-bottom: 12px;
}

.faq-answer ol,
.faq-answer ul {
    margin-left: 24px;
    margin-bottom: 16px;
}

.faq-answer li {
    margin-bottom: 8px;
}

.faq-answer strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
    background: var(--bg-gray);
}

.section-subtitle {
    text-align: center;
    font-size: 21px;
    color: var(--text-secondary);
    margin-bottom: 50px;
    font-weight: 400;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 17px;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 17px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--link-color);
}

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

.form-group textarea::placeholder {
    color: var(--text-secondary);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--link-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--link-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 400;
}

.form-message.success {
    background: rgba(52, 199, 89, 0.1);
    color: #30d158;
}

.form-message.error {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

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

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.screenshot-item {
    text-align: center;
}

.screenshot-item img {
    width: 100%;
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.screenshot-item:hover img {
    transform: scale(1.02);
}

.screenshot-item p {
    font-size: 17px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* AI Assistant Chat Widget */
.ai-assistant-btn {
    background: none;
    border: none;
    color: var(--link-color);
    font-size: 17px;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s;
}

.ai-assistant-btn:hover {
    opacity: 0.8;
}

.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: var(--bg-white);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.ai-chat-widget.active {
    display: flex;
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-icon {
    font-size: 24px;
}

.ai-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.ai-close-btn:hover {
    background-color: var(--bg-gray);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.47059;
}

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

.ai-message-user {
    background: var(--link-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-chat-input-container {
    display: flex;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    gap: 8px;
}

.ai-chat-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chat-input-container input:focus {
    border-color: var(--link-color);
}

.ai-send-btn {
    background: var(--link-color);
    color: white;
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    background: var(--link-hover);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chat-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.ai-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: ai-bounce 1.4s infinite ease-in-out both;
}

.ai-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes ai-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Footer */
.footer {
    background: var(--bg-gray);
    padding: 50px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 17px;
    margin-bottom: 8px;
    transition: color 0.2s;
}

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

.footer-section p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.47059;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 40px;
    }

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

    .nav-links {
        gap: 20px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 30px 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0 40px;
    }

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

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

    .nav {
        flex-direction: column;
        gap: 12px;
    }

    .nav-links {
        gap: 16px;
    }

    .ai-chat-widget {
        width: calc(100% - 40px);
        height: calc(100vh - 40px);
        max-height: 600px;
        bottom: 20px;
        right: 20px;
        left: 20px;
    }

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