/* Non-Critical Styles - Critical CSS is inline in base.html */
/* Updated font family when Inter loads */
body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    font-display: swap; /* Optimize font loading */
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    margin-bottom: 1rem;
    color: #666666;
    line-height: 1.7;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
    min-height: 48px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #2196f3;
    border: 2px solid #2196f3;
}

.btn-secondary:hover {
    background: #2196f3;
    color: white;
}

.btn-outline {
    background: transparent;
    color: #333333;
    border: 2px solid #e0e0e0;
}

.btn-outline:hover {
    background: #f5f5f5;
    border-color: #cccccc;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    min-height: 56px;
}

.btn-block {
    width: 100%;
}

/* Navigation - Non-critical styles */
.nav-link:hover {
    color: #2196f3;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-link {
    text-decoration: none;
    color: #666666;
    font-weight: 500;
    padding: 15px 10px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 18px;
}

/* Hero Section - Additional styles */

/* Phone Mockup - Additional styles */

.phone-screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
}

.telegram-chat {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: #2196f3;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-name {
    font-weight: 600;
    font-size: 14px;
}

.online-status {
    font-size: 12px;
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.message {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.4;
}

.bot-message {
    background: #f0f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.user-message {
    background: #2196f3;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.time-slots {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.time-slot {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}

.time-slot.active {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

/* Sections */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    margin-bottom: 1rem;
}

.section-description {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    color: #666666;
}

/* Features Section */
.features {
    background: white;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 1rem;
}

.feature-title {
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.feature-description {
    color: #666666;
}

/* How It Works */
.how-it-works {
    background: #f8fafe;
}

.steps-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    position: relative;
    gap: 2rem;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 220px;
    min-width: 200px;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2196f3, #4caf50);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 1rem;
    flex-shrink: 0;
}

.step-title {
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.step-description {
    color: #666666;
    max-width: 250px;
    margin: 0 auto;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

.step-arrow {
    position: absolute;
    right: -15px;
    top: 30px;
    font-size: 24px;
    color: #cccccc;
    z-index: 1;
}

.cta-section {
    text-align: center;
}

/* Benefits Section */
.benefits {
    background: white;
}

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

.benefits-title {
    margin-bottom: 2rem;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.benefit {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.benefit-icon {
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.benefit-text {
    color: #666666;
    line-height: 1.6;
}

.benefits-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.stat-card {
    background: #f8fafe;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
}

.stat-value {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    color: #2196f3;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Testimonials */
.testimonials {
    background: #f8fafe;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.testimonial-rating {
    margin-bottom: 1rem;
}

.star {
    font-size: 16px;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: #333333;
    line-height: 1.6;
}

.author-name {
    font-weight: 600;
    color: #1a1a1a;
}

.author-business {
    font-size: 0.9rem;
    color: #666666;
    margin-top: 0.25rem;
}

/* FAQ */
.faq {
    background: white;
}

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

.faq-item {
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 0;
    text-align: left;
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: color 0.3s ease;
    gap: 1rem;
}

.faq-question:hover {
    color: #2196f3;
}

.faq-question span:first-child {
    flex: 1;
    text-align: left;
    line-height: 1.4;
}

.faq-icon {
    font-size: 20px;
    color: #2196f3;
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: #1976d2;
}

.faq-item.active .faq-answer {
    padding: 0;
}

.faq-answer p {
    margin: 0;
    padding: 0.5rem 0 1.5rem 0;
    color: #666666;
    line-height: 1.6;
}

/* Final CTA */
.final-cta {
    background: linear-gradient(135deg, #f8fafe 0%, #f0f8ff 100%);
    border-top: 3px solid #2196f3;
    color: #333333;
    position: relative;
    overflow: hidden;
}

.final-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="%232196f3" opacity="0.1"/></svg>');
    pointer-events: none;
}

.cta-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.cta-description {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    color: #666666;
    margin-bottom: 2rem;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.cta-note {
    color: #666666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Footer */
.footer {
    background: #f8f9fa;
    color: #333333;
    padding: 2rem 0 1rem;
    border-top: 1px solid #e9ecef;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-brand .brand-text {
    color: #2196f3;
}

.footer-description {
    color: #666666;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.footer-section h4 {
    color: #333333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.3rem;
}

.footer-section a {
    color: #666666;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-section a:hover {
    color: #2196f3;
}

.footer-bottom {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 1rem;
    flex-direction: column;
}

.footer-social {
    display: flex;
    gap: 0.5rem;
}

.social-link {
    color: #666666;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
    padding: 4px;
}

.social-link:hover {
    color: #2196f3;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

    .hero-content {
        gap: 3rem;
    }

    .benefits-content {
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    /* Typography */
    h1 {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }

    h2 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

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

    .hero-stats {
        justify-content: center;
        gap: 1.5rem;
    }

    .stat {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        min-width: 120px;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    /* Steps */
    .steps-container {
        flex-direction: column;
        gap: 2.5rem;
        align-items: center;
        justify-content: center;
    }

    .step {
        min-height: auto;
        min-width: auto;
        text-align: center;
        max-width: 300px;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .step-arrow {
        display: none;
    }

    /* Benefits */
    .benefits-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .testimonial-card {
        padding: 1.5rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        justify-content: center;
    }

    /* CTA Actions */
    .cta-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    /* Buttons */
    .btn-large {
        padding: 14px 24px;
        font-size: 16px;
        min-height: 48px;
    }

    /* Sections */
    section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 3rem;
    }
}

@media (max-width: 480px) {
    /* Typography */
    h1 {
        font-size: clamp(1.5rem, 7vw, 2rem);
        line-height: 1.2;
    }

    h2 {
        font-size: clamp(1.25rem, 6vw, 1.75rem);
        line-height: 1.3;
    }

    h3 {
        font-size: clamp(1.125rem, 4vw, 1.5rem);
    }

    .mobile-menu-content {
        padding: 16px;
    }

    .hero-content {
        gap: 2rem;
    }

    .hero-description {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
        margin-bottom: 1.5rem;
    }

    .hero-actions {
        gap: 0.75rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .stat {
        min-width: auto;
        max-width: 200px;
    }

    .phone-mockup {
        padding: 12px;
    }

    .chat-header {
        padding: 12px;
    }

    .chat-messages {
        padding: 12px;
        gap: 10px;
    }

    .message {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Sections */
    section {
        padding: 50px 0;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .section-description {
        font-size: clamp(0.9rem, 4vw, 1rem);
    }

    /* Cards */
    .feature-card,
    .testimonial-card {
        padding: 1.25rem;
    }

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

    /* Steps */
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .step-description {
        font-size: 13px;
    }

    /* Benefits */
    .benefit {
        gap: 0.75rem;
    }

    .benefit-text {
        font-size: 14px;
    }

    .stat-card {
        padding: 1.5rem;
    }

    /* FAQ */
    .faq-question {
        padding: 1.25rem 0;
        font-size: clamp(0.95rem, 4vw, 1rem);
    }

    .faq-icon {
        font-size: 18px;
    }

    .faq-answer p {
        font-size: 14px;
        padding: 0.25rem 0 1.25rem 0;
    }

    /* Footer */
    .footer-links {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .footer-section h4 {
        font-size: 0.95rem;
    }

    .footer-section a {
        font-size: 0.85rem;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px;
    }

    .btn-large {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 46px;
    }

    /* CTA */
    .cta-note {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    /* Extra small screens */
    .container {
        padding: 0 12px;
    }

    .hero {
        padding: 80px 0 40px;
    }

    .phone-mockup {
        width: min(200px, 90vw);
        height: min(400px, 50vh);
        padding: 10px;
    }

    .feature-card,
    .testimonial-card {
        padding: 1rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 40px;
    }

    .btn-large {
        padding: 10px 18px;
        font-size: 14px;
        min-height: 42px;
    }
}

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

.feature-card,
.testimonial-card,
.step {
    animation: fadeInUp 0.6s ease-out;
}

/* Enhanced hover effects */
.feature-card:hover .feature-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    border-left: 4px solid #2196f3;
    transition: border-left 0.3s ease;
}

/* Loading state */
body.loaded .hero-title {
    animation: fadeInUp 0.8s ease-out;
}

body.loaded .hero-description {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

body.loaded .hero-actions {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .btn:hover {
        transform: none;
    }

    .feature-card:hover {
        transform: none;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.nav-link:focus,
.faq-question:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
        padding: 12px 20px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .faq-question {
        min-height: 48px;
        padding: 15px 0;
    }

    .mobile-nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* Improved scrolling on iOS */
@supports (-webkit-overflow-scrolling: touch) {
    .chat-messages {
        -webkit-overflow-scrolling: touch;
    }

    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Fix for iPhone safe areas */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .navbar {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #ffffff;
        --bg-color: #1a1a1a;
        --card-bg: #2d2d2d;
    }

    /* Keep light theme for now, but prepare for future dark mode */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000000;
        border: 2px solid #000000;
    }

    .btn-secondary {
        border-width: 3px;
    }

    .feature-card,
    .testimonial-card {
        border: 2px solid #333333;
    }
}

/* Optimize font rendering */
@font-face {
    font-family: "Inter";
    font-display: swap;
}

/* Optimize animations for performance */
@media (prefers-reduced-motion: no-preference) {
    .feature-card,
    .testimonial-card,
    .step {
        will-change: transform;
    }
}

/* Optimize images for performance */
img {
    content-visibility: auto;
    contain-intrinsic-size: 0 200px;
}

/* Optimize heavy animations */
.hero-content,
.features-grid,
.testimonials-grid {
    contain: layout style paint;
}

/* Reduce transparency on older devices */
@media (-webkit-max-device-pixel-ratio: 1) {
    .navbar {
        background: rgba(255, 255, 255, 1);
        backdrop-filter: none;
    }
}

/* Print styles */
@media print {
    .navbar,
    .mobile-menu,
    .footer {
        display: none !important;
    }

    .hero {
        padding: 2rem 0;
    }

    .phone-mockup {
        display: none;
    }

    .btn {
        border: 1px solid #333333;
        background: transparent !important;
        color: #333333 !important;
    }

    .section-title {
        break-after: avoid;
    }

    .feature-card,
    .testimonial-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #cccccc;
    }
}
