@font-face {
    font-family: 'main';
    src: url('../fonts/main.woff2') format('woff2'),
         url('../fonts/main.woff') format('woff'),
         url('../fonts/main.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-bg: #1f2937;
    --light-bg: #ffffff;
}

body {
    font-family: 'main', Tahoma, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.onboarding-active {
    overflow: hidden;
}

.font-main {
    font-family: 'main', Tahoma, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

#chat-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 50;
}

#chat-container {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    #chat-widget {
        bottom: 20px;
        left: 20px;
    }

    #chat-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 70vh;
        border-radius: 20px 20px 0 0;
    }
}

#chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.message-content {
    animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
}

.filter-btn {
    transition: all 0.3s ease;
}

.testimonial-card {
    transition: all 0.5s ease;
}

.counter-complete {
    animation: counterPulse 0.3s ease;
}

@keyframes counterPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.toast {
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#voice-input-btn.recording {
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
    0%, 100% {
        background: rgba(239, 68, 68, 0.2);
        transform: scale(1);
    }
    50% {
        background: rgba(239, 68, 68, 0.4);
        transform: scale(1.05);
    }
}

.offline-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #f59e0b 0px,
        #f59e0b 10px,
        transparent 10px,
        transparent 20px
    );
    z-index: 9999;
    animation: offlineStripe 1s linear infinite;
}

@keyframes offlineStripe {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 20px 0;
    }
}

mark {
    background: #fef3c7;
    padding: 2px 4px;
    border-radius: 2px;
}

.dark mark {
    background: #92400e;
    color: #fef3c7;
}

section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media print {
    #chat-widget,
    #chat-container,
    #progress-bar,
    #theme-toggle,
    #menu-toggle {
        display: none !important;
    }
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.safe-area-inset {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}