/* Modern Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: 
        linear-gradient(135deg, #f0f9ff 0%, #f8fafc 25%, #ffffff 50%, #f1f5f9 75%, #ecfdf5 100%),
        radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(5, 150, 105, 0.05) 0%, transparent 60%),
        radial-gradient(circle at 50% 10%, rgba(34, 197, 94, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Global background decorative layer */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(5, 150, 105, 0.025) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(34, 197, 94, 0.02) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Button Styles for page content (non-navbar) */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

.btn-secondary {
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    color: #000000;
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 128px 0 80px;
    margin-top: 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 600px;
}

/* Hero animation styles moved to hero-animation.css for modularity */

.hero-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-text {
    font-family: 'JetBrains Mono', monospace;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 24px;
    line-height: 1.2;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Workspace Section */
.workspace-section {
    padding: 100px 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 70% 70%, rgba(5, 150, 105, 0.06) 0%, transparent 70%),
        radial-gradient(circle at 50% 90%, rgba(34, 197, 94, 0.04) 0%, transparent 60%);
    position: relative;
    overflow: hidden;
}

.workspace-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 30%, transparent 70%),
        radial-gradient(circle at 70% 70%, rgba(5, 150, 105, 0.18) 0%, rgba(5, 150, 105, 0.08) 35%, transparent 75%),
        radial-gradient(circle at 50% 90%, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 40%, transparent 80%);
    pointer-events: none;
    z-index: 1;
}

.workspace-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(16, 185, 129, 0.15) 15%, 
        rgba(16, 185, 129, 0.25) 35%, 
        rgba(16, 185, 129, 0.2) 50%, 
        rgba(16, 185, 129, 0.15) 65%, 
        transparent 85%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 0 100px rgba(16, 185, 129, 0.1);
}

.workspace-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 40px;
    align-items: start;
    position: relative;
    z-index: 10;
}

/* Additional decorative elements */
.workspace-section .decorative-element-left {
    position: absolute;
    top: 20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: 
        radial-gradient(circle at center, rgba(6, 182, 212, 0.2) 0%, rgba(14, 165, 233, 0.15) 40%, transparent 70%),
        linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(14, 165, 233, 0.08) 100%);
    border-radius: 50%;
    animation: float 25s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 0 150px rgba(6, 182, 212, 0.08);
}

.workspace-section .decorative-grid {
    position: absolute;
    bottom: 10%;
    left: 10%;
    width: 300px;
    height: 300px;
    background-image: 
        linear-gradient(rgba(16, 185, 129, 0.25) 2px, transparent 2px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.25) 2px, transparent 2px);
    background-size: 25px 25px;
    animation: fadeInOut 15s ease-in-out infinite;
    pointer-events: none;
    opacity: 1;
    z-index: 2;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

.workspace-section .decorative-rings {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.workspace-section .ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid;
    animation: ringPulse 20s ease-in-out infinite;
}

.workspace-section .ring-1 {
    top: 20%;
    left: 60%;
    width: 120px;
    height: 120px;
    border-color: rgba(16, 185, 129, 0.3);
    animation-delay: 0s;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.workspace-section .ring-2 {
    top: 55%;
    left: 15%;
    width: 80px;
    height: 80px;
    border-color: rgba(5, 150, 105, 0.4);
    animation-delay: 7s;
    box-shadow: 0 0 25px rgba(5, 150, 105, 0.25);
}

.workspace-section .ring-3 {
    bottom: 15%;
    right: 30%;
    width: 150px;
    height: 150px;
    border-color: rgba(34, 197, 94, 0.25);
    animation-delay: 14s;
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.15);
}

.workspace-section .decorative-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.workspace-section .shape {
    position: absolute;
    animation: shapeFloat 15s ease-in-out infinite;
}

.workspace-section .shape-triangle {
    top: 15%;
    right: 15%;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid rgba(16, 185, 129, 0.3);
    animation-delay: 0s;
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.2));
}

.workspace-section .shape-diamond {
    top: 45%;
    right: 25%;
    width: 30px;
    height: 30px;
    background: rgba(5, 150, 105, 0.25);
    transform: rotate(45deg);
    animation-delay: 5s;
    border-radius: 3px;
    box-shadow: 0 0 20px rgba(5, 150, 105, 0.2);
}

.workspace-section .shape-hexagon {
    bottom: 25%;
    right: 10%;
    width: 40px;
    height: 23px;
    background: rgba(34, 197, 94, 0.2);
    position: relative;
    animation-delay: 10s;
}

.workspace-section .shape-hexagon:before,
.workspace-section .shape-hexagon:after {
    content: "";
    position: absolute;
    width: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
}

.workspace-section .shape-hexagon:before {
    bottom: 100%;
    border-bottom: 11.5px solid rgba(34, 197, 94, 0.2);
}

.workspace-section .shape-hexagon:after {
    top: 100%;
    border-top: 11.5px solid rgba(34, 197, 94, 0.2);
}

.workspace-section .decorative-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.workspace-section .line {
    position: absolute;
    background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.4) 50%, transparent 100%);
    height: 3px;
    animation: lineFlow 12s ease-in-out infinite;
    border-radius: 2px;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.workspace-section .line-1 {
    top: 25%;
    left: 0;
    right: 0;
    animation-delay: 0s;
}

.workspace-section .line-2 {
    top: 50%;
    left: 0;
    right: 0;
    animation-delay: 4s;
    background: linear-gradient(90deg, transparent 0%, rgba(5, 150, 105, 0.35) 50%, transparent 100%);
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.25);
}

.workspace-section .line-3 {
    top: 75%;
    left: 0;
    right: 0;
    animation-delay: 8s;
    background: linear-gradient(90deg, transparent 0%, rgba(34, 197, 94, 0.3) 50%, transparent 100%);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

.workspace-section .decorative-dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.workspace-section .dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: 
        radial-gradient(circle at center, rgba(16, 185, 129, 0.8) 0%, rgba(16, 185, 129, 0.6) 50%, rgba(5, 150, 105, 0.4) 100%);
    border-radius: 50%;
    animation: twinkle 8s ease-in-out infinite;
    box-shadow: 
        0 0 20px rgba(16, 185, 129, 0.6),
        0 0 40px rgba(16, 185, 129, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.workspace-section .dot-1 {
    top: 15%;
    left: 15%;
    animation-delay: 0s;
}

.workspace-section .dot-2 {
    top: 25%;
    right: 20%;
    animation-delay: 2s;
}

.workspace-section .dot-3 {
    top: 60%;
    left: 25%;
    animation-delay: 4s;
}

.workspace-section .dot-4 {
    bottom: 20%;
    right: 15%;
    animation-delay: 6s;
}

.workspace-section .dot-5 {
    top: 40%;
    left: 60%;
    animation-delay: 1s;
}

.workspace-section .dot-6 {
    top: 70%;
    right: 40%;
    animation-delay: 3s;
}

.workspace-section .dot-7 {
    top: 10%;
    left: 70%;
    animation-delay: 5s;
}

.workspace-section .dot-8 {
    bottom: 30%;
    left: 40%;
    animation-delay: 7s;
}

/* Card Styles */
.config-card,
.chat-card {
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 20px;
    box-shadow: 
        0 8px 25px -8px rgba(0, 0, 0, 0.1), 
        0 4px 6px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(20px);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.8) 100%);
}

.config-card::before,
.chat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(16, 185, 129, 0.3) 50%, 
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.config-card:hover,
.chat-card:hover {
    box-shadow: 
        0 12px 35px -8px rgba(0, 0, 0, 0.15), 
        0 8px 15px -3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 0 0 1px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.config-card:hover::before,
.chat-card:hover::before {
    opacity: 1;
}

.card-header {
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding-bottom: 20px;
}

.title-icon {
    width: 24px;
    height: 24px;
    color: #10b981;
}



/* Form Styles */
.config-form {
    padding: 0 24px 16px 24px;
    display: flex;
    flex-direction: column;
    min-height: 350px;
    max-height: none;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #ffffff;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 45px;
}

.form-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-select:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.config-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
}

/* Chat Styles */
.chat-workspace {
    padding: 0 32px 40px 32px;
    display: flex;
    flex-direction: column;
    height: 650px;
}

/* Mobile chat workspace optimization */
@media (max-width: 768px) {
    .chat-workspace {
        position: relative;
        padding-bottom: 120px; /* Space for fixed footer */
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: #f8fafc;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    min-height: 450px;
}

.welcome-message {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}

.welcome-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    color: #10b981;
}

.welcome-icon svg {
    width: 100%;
    height: 100%;
}

.welcome-message h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.welcome-message p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.chat-input-area {
    margin-top: auto;
    position: relative;
    z-index: 10; /* Ensure it stays above other elements */
}

.input-container {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 20px 24px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    min-height: 60px;
    max-height: 120px;
    background: #ffffff;
    transition: all 0.3s ease;
    overflow-y: hidden;
}

.message-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.send-button {
    padding: 20px 28px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.send-button:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-button svg {
    width: 18px;
    height: 18px;
}

/* Batch processing styles removed */

/* Message Styles */
.message {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
}

.message.user {
    background: #10b981;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    position: relative;
}

.message-audio {
    margin-top: 12px;
}

.message-timing {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
}

.message.assistant .message-timing {
    color: #6b7280;
}

.tts-metrics {
    font-size: 0.75rem;
    color: #6b7280;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
}

/* Audio Section */
.audio-section {
    padding: 60px 0;
    background: #f8fafc;
}

.audio-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

.audio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.audio-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.audio-count {
    background: #10b981;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
}

.audio-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #374151;
}

.control-btn:hover {
    background: #f9fafb;
    border-color: #10b981;
    color: #059669;
}

.control-btn.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Audio Player Styles */
.custom-audio-player {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.play-pause-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #10b981;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.play-pause-btn:hover:not(:disabled) {
    background: #059669;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.play-pause-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

/* Footer Terms */
.footer-terms {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(229, 231, 235, 0.6);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 50; /* Reduced z-index to stay below chat buttons */
    padding: 16px 0;
}

.terms-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

.terms-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.terms-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #10b981;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-text {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    font-weight: 400;
}

.terms-link {
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.terms-link:hover {
    text-decoration: underline;
    color: #059669;
}

/* Add bottom spacing for fixed footer */
body {
    padding-bottom: 80px;
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    body {
        padding-bottom: 120px; /* More space on mobile */
    }
    
    .footer-terms {
        z-index: 10; /* Lower z-index on mobile */
    }
}

/* Loading and Status Styles */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top: 3px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
    font-size: 14px;
}

.success-message {
    background: #f0fdf4;
    color: #16a34a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #bbf7d0;
    font-size: 14px;
}

/* Enhanced decorative elements for large screens */
@media (min-width: 1400px) {
    .workspace-section::after {
        width: 800px;
        height: 800px;
        top: -60%;
        right: -25%;
    }
    
    .workspace-section .decorative-element-left {
        width: 500px;
        height: 500px;
        left: -15%;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .workspace-container {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 800px;
    }
    
    .workspace-section .decorative-element-left {
        width: 300px;
        height: 300px;
        left: -20%;
    }
    
    .workspace-section .decorative-grid {
        width: 150px;
        height: 150px;
        background-size: 15px 15px;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .workspace-container {
        padding: 0 12px;
        gap: 16px;
    }
    
    .config-form {
        padding: 0 16px 12px 16px;
        min-height: 300px;
        max-height: none;
    }
    
    .chat-workspace {
        padding: 0 16px 180px 16px; /* Extra bottom padding for very small screens */
        height: 400px; /* Increased height for better visibility */
    }
    
    .card-header {
        padding: 16px 16px 0 16px;
        margin-bottom: 16px;
    }
    
    .chat-messages {
        padding: 20px;
        min-height: 300px;
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 14px 40px 14px 16px;
    }
    
    /* Ensure send button is always visible */
    .send-button {
        min-height: 50px;
        white-space: nowrap;
        flex-shrink: 0;
        margin-bottom: 30px; /* Extra space for very small screens */
        position: relative;
        z-index: 100;
    }
    
    /* Extra input container spacing for very small screens */
    .input-container {
        margin-bottom: 60px; /* More space above fixed footer */
        padding-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .btn-large {
        width: 100%;
        padding: 14px 24px;
    }
    
    .hero-section {
        padding: 100px 0 60px;
        min-height: 500px;
    }
    
    .hero-container {
        padding: 0 16px;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
        margin-bottom: 32px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    
    .workspace-section {
        padding: 60px 0;
    }
    
    .workspace-section .decorative-element-left,
    .workspace-section .decorative-grid,
    .workspace-section .decorative-dots,
    .workspace-section .decorative-lines,
    .workspace-section .decorative-shapes,
    .workspace-section .decorative-rings {
        display: none;
    }
    
    .workspace-container {
        padding: 0 16px;
        gap: 20px;
    }
    
    .card-header {
        padding: 20px 20px 0 20px;
        margin-bottom: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .config-form {
        padding: 0 20px 15px 20px;
        height: 400px;
    }
    
    .chat-workspace {
        padding: 0 20px 160px 20px; /* Increased bottom padding for fixed footer */
        height: 450px; /* Increased height to accommodate button */
    }
    
    /* Fix form select dropdown width on mobile */
    .form-select {
        font-size: 14px;
        padding: 12px 40px 12px 16px;
        background-size: 14px;
        background-position: right 12px center;
        min-width: 0;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Improve chat input area for mobile */
    .input-container {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        margin-bottom: 40px; /* Increased space above fixed footer */
        padding-bottom: 20px; /* Extra padding to ensure button visibility */
    }
    
    .message-input {
        min-height: 50px;
        max-height: 100px;
        padding: 16px 20px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .send-button {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
        border-radius: 12px;
        justify-content: center;
        margin-bottom: 20px; /* Ensure space below button */
        position: relative;
        z-index: 100; /* High z-index to stay above footer */
    }
    
    .send-button svg {
        width: 20px;
        height: 20px;
    }
    
    .audio-container {
        padding: 0 16px;
    }
    
    .audio-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .audio-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .terms-container {
        padding: 0 16px;
    }
    
    .terms-text {
        font-size: 13px;
    }
    
    body {
        padding-bottom: 100px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .sound-wave {
        animation: none !important;
    }
    
    .btn:hover {
        transform: none !important;
    }
    
    .config-card:hover,
    .chat-card:hover {
        transform: none !important;
    }
}

/* Focus styles for better accessibility */
.btn:focus,
.form-select:focus,
.message-input:focus,
.file-textarea:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000000;
        border-color: #000000;
    }
    
    .btn-outline {
        border-color: #000000;
        color: #000000;
    }
    
    .hero-title {
        color: #000000;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body {
        background: #0f172a;
        color: #e2e8f0;
    }
    
    
    .config-card,
    .chat-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .chat-messages {
        background: #0f172a;
        border-color: #334155;
    }
    
    .message-input,
    .form-select,
    .file-textarea {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
}

/* Login Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: #6b7280;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.login-button {
    width: 100%;
    padding: 12px 24px;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
}

.login-button:hover {
    background: #1f2937;
}

.login-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Modal Error and Success Messages */
.modal-content .error-message {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    margin-top: 12px;
}

.modal-content .success-message {
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    margin-top: 12px;
}


/* Modal Animations */
/* Workspace decorative animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    33% {
        transform: translateY(-20px) rotate(2deg);
        opacity: 0.5;
    }
    66% {
        transform: translateY(10px) rotate(-1deg);
        opacity: 0.4;
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.8);
        box-shadow: 
            0 0 15px rgba(16, 185, 129, 0.4),
            0 0 30px rgba(16, 185, 129, 0.2);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
        box-shadow: 
            0 0 30px rgba(16, 185, 129, 0.8),
            0 0 60px rgba(16, 185, 129, 0.4),
            0 0 90px rgba(16, 185, 129, 0.2);
    }
}

@keyframes lineFlow {
    0% {
        opacity: 0;
        transform: translateX(-100%) scaleX(0.5);
    }
    25% {
        opacity: 0.8;
        transform: translateX(-50%) scaleX(1);
    }
    75% {
        opacity: 0.9;
        transform: translateX(50%) scaleX(1);
    }
    100% {
        opacity: 0;
        transform: translateX(100%) scaleX(0.5);
    }
}

@keyframes shapeFloat {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        opacity: 0.6;
        transform: translateY(-15px) rotate(90deg);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) rotate(180deg);
    }
    75% {
        opacity: 0.6;
        transform: translateY(-20px) rotate(270deg);
    }
}

@keyframes ringPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1) rotate(0deg);
        border-width: 2px;
    }
    25% {
        opacity: 0.7;
        transform: scale(1.1) rotate(90deg);
        border-width: 4px;
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05) rotate(180deg);
        border-width: 3px;
    }
    75% {
        opacity: 0.6;
        transform: scale(1.15) rotate(270deg);
        border-width: 5px;
    }
}

/* Modal animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
} 