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

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #4a4a4a;
    background-color: #fefefe;
    overflow-x: hidden;
}

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

/* Color Palette */
:root {
    --primary-blue: #f0f8ff;
    --secondary-blue: #e6f3ff;
    --accent-blue: #b3d9ff;
    --dark-blue: #87ceeb;
    --white: #ffffff;
    --light-gray: #f8f8f8;
    --medium-gray: #e0e0e0;
    --dark-gray: #6b6b6b;
    --text-dark: #3a3a3a;
    --text-light: #8a8a8a;
    --gradient-primary: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    --gradient-secondary: linear-gradient(135deg, #e6f3ff 0%, #b3d9ff 100%);
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--medium-gray);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo h2 {
    color: var(--dark-blue);
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--dark-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--dark-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--gradient-primary);
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
    animation: heroFadeIn 1.5s ease-out;
}

@keyframes heroFadeIn {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23d4c4b0" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: titleSlideIn 1s ease-out 0.5s both;
}

@keyframes titleSlideIn {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.highlight {
    color: var(--dark-blue);
    position: relative;
    animation: highlightGlow 2s ease-in-out infinite alternate;
}

@keyframes highlightGlow {
    0% {
        text-shadow: 0 0 10px rgba(135, 206, 235, 0.3);
    }
    100% {
        text-shadow: 0 0 20px rgba(135, 206, 235, 0.6), 0 0 30px rgba(135, 206, 235, 0.4);
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    animation: subtitleSlideIn 1s ease-out 0.7s both;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--dark-gray);
    line-height: 1.7;
    animation: descriptionSlideIn 1s ease-out 0.9s both;
}

@keyframes subtitleSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes descriptionSlideIn {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: buttonsSlideIn 1s ease-out 1.1s both;
}

@keyframes buttonsSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: var(--dark-blue);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--accent-blue);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 35px rgba(135, 206, 235, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-dark);
    border-color: var(--dark-blue);
}

.btn-secondary:hover {
    background-color: var(--dark-blue);
    color: var(--white);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 35px rgba(135, 206, 235, 0.3);
}

.btn-accent {
    background-color: var(--accent-blue);
    color: var(--white);
}

.btn-accent:hover {
    background-color: var(--dark-blue);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 35px rgba(135, 206, 235, 0.4);
}

/* Hero Visual */
.hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.communication-flow {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    animation: flowSlideIn 1s ease-out 1.3s both;
    position: relative;
    overflow: hidden;
}

.communication-flow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(135, 206, 235, 0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes flowSlideIn {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.flow-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.flow-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.flow-icon:hover {
    transform: scale(1.1) rotate(360deg);
    box-shadow: 0 10px 25px rgba(135, 206, 235, 0.4);
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--dark-blue);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ai-badge {
    background: var(--gradient-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
    box-shadow: var(--shadow-light);
}

/* Section Styles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-secondary);
    border-radius: 2px;
}




/* Features Section */
.features {
    padding: 6rem 0;
    background-color: var(--white);
}

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

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--medium-gray);
    transition: all 0.4s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(135, 206, 235, 0.2);
    border-color: var(--dark-blue);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.feature-icon:hover {
    transform: scale(1.1) rotate(360deg);
    box-shadow: 0 10px 25px rgba(135, 206, 235, 0.4);
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--dark-gray);
    line-height: 1.6;
}

/* Translation Sections */
.sign-to-speech,
.speech-to-sign {
    padding: 6rem 0;
}

.sign-to-speech {
    background-color: var(--primary-blue);
}

.speech-to-sign {
    background-color: var(--white);
}

.translation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.translation-container.reverse {
    direction: rtl;
}

.translation-container.reverse > * {
    direction: ltr;
}

/* Camera Section */
.camera-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
}

.camera-preview {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--light-gray);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

#signVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.detection-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px dashed var(--dark-blue);
    border-radius: 10px;
    opacity: 0.7;
}

.status-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.status-indicator i {
    color: #4ade80;
    animation: pulse 2s infinite;
}

.camera-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Translation Output */
.translation-output {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
}

.output-section {
    margin-bottom: 2rem;
}

.output-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.text-output {
    background: var(--primary-blue);
    padding: 1.5rem;
    border-radius: 10px;
    min-height: 100px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-dark);
    border: 1px solid var(--medium-gray);
}

.speech-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.audio-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 60px;
    background: var(--primary-blue);
    border-radius: 10px;
    padding: 1rem;
}

.sound-wave {
    width: 4px;
    height: 20px;
    background: var(--dark-blue);
    border-radius: 2px;
    animation: wave 1.5s ease-in-out infinite;
}

.sound-wave:nth-child(2) { animation-delay: 0.1s; }
.sound-wave:nth-child(3) { animation-delay: 0.2s; }
.sound-wave:nth-child(4) { animation-delay: 0.3s; }
.sound-wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 20px; }
    50% { height: 40px; }
}

/* Avatar Section */
.avatar-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
}

.avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* 3D Avatar Container */
.avatar-3d-container {
    position: relative;
    width: 400px;
    height: 500px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

#avatarCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
}

.avatar-status {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.avatar-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Sign Language Dictionary */
.sign-dictionary {
    width: 100%;
    background: var(--primary-blue);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
}

.sign-dictionary h4 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.sign-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.sign-btn {
    padding: 0.75rem;
    border: none;
    background: var(--white);
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.sign-btn:hover {
    background: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.sign-btn:active {
    transform: translateY(0);
}

/* Speech Input */
.speech-input {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
}

.input-section {
    margin-bottom: 2rem;
}

.microphone-visualizer {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
}

.mic-circle {
    width: 100%;
    height: 100%;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-dark);
    position: relative;
    z-index: 2;
}

.sound-rings {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--dark-blue);
    border-radius: 50%;
    opacity: 0;
}

.ring:nth-child(1) { width: 120px; height: 120px; }
.ring:nth-child(2) { width: 140px; height: 140px; }
.ring:nth-child(3) { width: 160px; height: 160px; }

.recognition-status {
    text-align: center;
    padding: 1rem;
    background: var(--primary-blue);
    border-radius: 10px;
    color: var(--text-dark);
    font-weight: 500;
}

#textInput {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 1rem;
}

#textInput:focus {
    outline: none;
    border-color: var(--dark-blue);
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.1);
}

/* Learn Section */
.learn {
    padding: 6rem 0;
    background-color: var(--primary-blue);
}

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

.learning-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: all 0.3s ease;
}

.learning-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.learning-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--text-dark);
}

.learning-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.learning-card p {
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* About Section */
.about {
    padding: 6rem 0;
    background-color: var(--white);
}

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

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--dark-gray);
    line-height: 1.7;
}

.stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

.stat p {
    color: var(--text-light);
    font-weight: 500;
}

.about-visual {
    display: flex;
    justify-content: center;
}

.accessibility-symbols {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.symbol {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--primary-blue);
    border-radius: 15px;
    box-shadow: var(--shadow-light);
}

.symbol i {
    font-size: 2rem;
    color: var(--dark-blue);
}

.symbol span {
    font-weight: 600;
    color: var(--text-dark);
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: var(--white);
    padding: 3rem 0 1rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--white);
}

.footer-section ul li i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--dark-gray);
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-medium);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .communication-flow {
        flex-direction: column;
        gap: 1rem;
    }

    .translation-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .stats {
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .camera-controls,
    .speech-controls,
    .avatar-controls {
        flex-direction: column;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

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

/* Advanced Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

.rotate-in {
    opacity: 0;
    transform: rotate(-10deg) scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.bounce-in {
    opacity: 0;
    transform: scale(0.3) translateY(-50px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bounce-in.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.flip-in {
    opacity: 0;
    transform: perspective(400px) rotateY(90deg);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.flip-in.visible {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg);
}

/* Active states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Loading states */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--medium-gray);
    border-top: 3px solid var(--dark-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Microphone animation */
.microphone-visualizer.listening .ring {
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Advanced Avatar animations */
.avatar-3d.animating .left-arm {
    animation: signLeft 1s ease-in-out;
}

.avatar-3d.animating .right-arm {
    animation: signRight 1s ease-in-out;
}

.avatar-3d.animating .avatar-head {
    animation: headNod 0.5s ease-in-out 0.5s;
}

.avatar-3d.animating .avatar-body-main {
    animation: bodySway 2s ease-in-out;
}

@keyframes signLeft {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-30deg); }
    75% { transform: rotate(-60deg); }
}

@keyframes signRight {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(30deg); }
    75% { transform: rotate(60deg); }
}

@keyframes headNod {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(5deg); }
}

@keyframes bodySway {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(2deg); }
    75% { transform: translateX(-50%) rotate(-2deg); }
}

/* Floating Animation for Cards */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Glow Effects */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(135, 206, 235, 0.5);
    }
    to {
        box-shadow: 0 0 30px rgba(135, 206, 235, 0.8), 0 0 40px rgba(135, 206, 235, 0.3);
    }
}

/* Magnetic Hover Effect */
.magnetic {
    transition: transform 0.3s ease;
}

.magnetic:hover {
    transform: scale(1.05);
}

/* Particle Background */
.particle-bg {
    position: relative;
    overflow: hidden;
}

.particle-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(135, 206, 235, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(135, 206, 235, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(135, 206, 235, 0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(135, 206, 235, 0.3), transparent);
    background-repeat: repeat;
    background-size: 150px 100px;
    animation: particleMove 20s linear infinite;
}

@keyframes particleMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-150px, -100px);
    }
}
