/* General Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #fff 0%, #faf8f5 100%);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    position: relative;
    border-top: 3px solid #ff6b35;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #ffd700, #ff6b35);
    border-radius: 8px 8px 0 0;
}

.header-left {
    flex: 1;
}

.header-right {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
}

.company-logo {
    height: 60px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: all 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 5px;
}

.company-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Religious App Title Styling */
.app-title {
    margin-bottom: 15px;
    margin-right: 80px; /* Give space for the logo */
    display: flex;
    align-items: baseline;
    gap: 0px; /* No gap for seamless word */
    position: relative;
}

.krish {
    font-family: 'Cinzel', serif;
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(255, 107, 53, 0.3);
    position: relative;
    letter-spacing: 0px;
    margin-right: -2px; /* Slight negative margin to connect seamlessly */
}

.krish::before {
    content: '🕉️';
    position: absolute;
    left: -30px;
    top: -5px;
    font-size: 1.4rem;
    animation: gentleGlow 3s ease-in-out infinite;
}

.guru {
    font-family: 'Cinzel', serif;
    font-size: 2.4rem;
    font-weight: 600;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 1px 1px 2px rgba(30, 60, 114, 0.3);
    position: relative;
    letter-spacing: 0px;
}

.guru::after {
    content: '📚';
    position: absolute;
    right: -30px;
    top: -5px;
    font-size: 1.4rem;
    animation: gentleGlow 3s ease-in-out infinite 1.5s;
}

.subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 400;
    color: #7f8c8d;
    font-style: italic;
    position: absolute;
    bottom: -20px;
    left: 0;
    letter-spacing: 1.5px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.app-title:hover .subtitle {
    opacity: 1;
    color: #5d6d7e;
}

.app-title:hover .krish::before,
.app-title:hover .guru::after {
    animation: gentleGlow 1s ease-in-out infinite;
}

/* Gentle glow animation for spiritual symbols */
@keyframes gentleGlow {
    0%, 100% { 
        opacity: 0.7;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Legacy h1 styling for backwards compatibility */
header h1:not(.app-title) {
    margin-bottom: 15px;
    color: #2c3e50;
    margin-right: 80px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.voice-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.voice-selector {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    min-width: 180px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.toggle-label {
    font-size: 0.9rem;
    color: #555;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #3498db;
}

input:focus + .slider {
    box-shadow: 0 0 1px #3498db;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Speed Control */
.speed-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 10px;
}

.speed-label {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 5px;
}

#speedSlider {
    width: 100px;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 5px;
}

#speedSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

#speedSlider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    background-color: #e0e0e0;
}

.btn:hover {
    background-color: #d0d0d0;
}

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

.primary {
    background-color: #3498db;
    color: white;
}

.primary:hover {
    background-color: #2980b9;
}

.nav-btn {
    min-width: 100px;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #3498db;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Content Area Styles */
.content-area {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    flex: 1;
}

.page-info {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.encryption-status {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
    animation: secureGlow 2s infinite;
}

@keyframes secureGlow {
    0%, 100% { box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3); }
    50% { box-shadow: 0 2px 8px rgba(39, 174, 96, 0.5); }
}

.content-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.text-container, .image-container {
    flex: 1;
    min-height: 450px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
}

.text-container {
    flex: 2; /* Give text container more space than image container */
}

.text-container h2, .image-container h2 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.text-content {
    height: 100%;
    overflow-y: auto;
    line-height: 1.8;
}

.text-content p {
    margin-bottom: 20px;
    text-align: justify;
    text-indent: 2em;
    max-width: 100%;
    line-height: 1.8;
}

/* Sentence styling for better readability */
.text-content .sentence {
    margin-right: 8px;
}

.text-content br {
    display: block;
    content: "";
    margin-top: 0.5em;
}

.line-highlight {
    background-color: #f2faff;
    border-left: 4px solid #8fd0ff;
    padding: 4px 6px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(134, 210, 255, 0.35);
}

/* Highlighted text */
.highlight {
    background-color: #e6f7ff;
    border-radius: 5px;
    padding: 2px 4px;
    box-shadow: 0 0 8px rgba(134, 210, 255, 0.6);
    font-weight: 600;
    color: #0b3954;
    position: relative;
    display: inline-block;
    animation: sentenceGlow 2s ease-in-out infinite;
    border-left: 3px solid #8fd0ff;
    margin: 1px 0;
}

/* Sentence highlighting styles */
.sentence {
    display: inline-block;
    margin: 2px 0;
    padding: 1px 2px;
    border-radius: 3px;
    transition: all 0.3s ease;
    line-height: 1.6;
}

.sentence.highlight {
    background: linear-gradient(135deg, #e6f7ff 0%, #cdeeff 100%);
    border-left: 4px solid #8fd0ff;
    box-shadow: 0 2px 10px rgba(134, 210, 255, 0.45);
    transform: translateY(-1px);
    z-index: 1;
}

@keyframes sentenceGlow {
    0%, 100% { 
        box-shadow: 0 2px 10px rgba(255, 193, 7, 0.4);
        transform: translateY(-1px);
    }
    50% { 
        box-shadow: 0 4px 15px rgba(255, 193, 7, 0.6);
        transform: translateY(-2px);
    }
}

/* Word highlighting (legacy support) */
.word.highlight {
    background-color: #e6f7ff;
    border-radius: 4px;
    padding: 0 3px;
    box-shadow: 0 0 8px rgba(134, 210, 255, 0.6);
    font-weight: 600;
    color: #0b3954;
    border-left: 3px solid #8fd0ff;
    position: relative;
    display: inline-block;
}

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

.image-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 500px;
}

.image-content img {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Processing Status */
.processing-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 250px;
}

.processing-status .spinner {
    width: 25px;
    height: 25px;
    margin-bottom: 10px;
}

.processing-status p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.processing-progress-container {
    width: 100%;
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.processing-progress-bar {
    height: 100%;
    background-color: #3498db;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.spinner.small {
    width: 22px;
    height: 22px;
    border-width: 3px;
}

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

/* No Content Message */
.no-content-message {
    text-align: center;
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.no-content-message p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 15px 0;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.supported-formats {
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Krishna Avatar Styles */
.krishna-avatar-container {
    flex: 0 0 200px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-right: 15px;
    position: relative;
}

.krishna-avatar {
    position: relative;
    width: 180px;
    height: 220px;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    border-radius: 15px;
    border: 2px solid #ff6b35;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: gentleBreathe 4s ease-in-out infinite;
}

/* Krishna Body */
.krishna-body {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Krishna Head */
.krishna-head {
    position: relative;
    width: 80px;
    height: 80px;
    margin-top: 15px;
}

.krishna-face {
    width: 100%;
    height: 100%;
    background: #ffdbac;
    border-radius: 50%;
    position: relative;
    border: 2px solid #d4965f;
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.1);
}

/* Eyes */
.krishna-eyes {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
}

.eye {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: relative;
    border: 1px solid #333;
}

.pupil {
    width: 8px;
    height: 8px;
    background: #1a1a1a;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: eyeMovement 6s ease-in-out infinite;
}

.krishna-nose {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 5px;
    background: #d4965f;
    border-radius: 2px;
}

.krishna-smile {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    border: 1px solid #d4965f;
    border-top: none;
    border-radius: 0 0 20px 20px;
    animation: smile 3s ease-in-out infinite;
}

/* Hair and Crown */
.krishna-hair {
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 55px;
    background: #1a1a1a;
    border-radius: 45px 45px 0 0;
    z-index: -1;
}

.krishna-crown {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 18px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 9px;
    border: 1px solid #ff6b35;
    z-index: 1;
}

.peacock-feather {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 28px;
    background: linear-gradient(to top, #4a90e2, #7ed321, #f5a623);
    border-radius: 3px;
    z-index: 2;
    animation: featherSway 3s ease-in-out infinite;
}

.peacock-feather::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #4a90e2, #7ed321);
    border-radius: 50%;
    border: 1px solid #333;
}

/* Torso */
.krishna-torso {
    position: relative;
    width: 95px;
    height: 115px;
    margin-top: 8px;
}

.krishna-clothes {
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 15px;
    border: 1px solid #d4965f;
    position: relative;
}

.krishna-clothes::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 7px;
    right: 7px;
    height: 20px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 10px;
}

/* Arms */
.krishna-arms {
    position: absolute;
    top: 15px;
    width: 100%;
    height: 55px;
}

.arm {
    position: absolute;
    width: 25px;
    height: 55px;
    background: #ffdbac;
    border-radius: 12px;
    border: 1px solid #d4965f;
}

.left-arm {
    left: -18px;
    transform-origin: top center;
    animation: leftArmMove 4s ease-in-out infinite;
}

.right-arm {
    right: -18px;
    transform-origin: top center;
    animation: rightArmMove 4s ease-in-out infinite;
}

.hand {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: #ffdbac;
    border-radius: 50%;
    border: 1px solid #d4965f;
}

/* Flute */
.flute {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) rotate(-15deg);
    z-index: 10;
    animation: flutePlay 2s ease-in-out infinite;
}

.flute-body {
    width: 80px;
    height: 6px;
    background: linear-gradient(to right, #8b4513, #a0522d);
    border-radius: 3px;
    position: relative;
    border: 1px solid #654321;
}

.flute-holes {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    left: 15px;
}

.hole {
    width: 3px;
    height: 3px;
    background: #333;
    border-radius: 50%;
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid #4a90e2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 160px;
    z-index: 20;
    animation: speechBubbleFloat 2s ease-in-out infinite;
}

.speech-text {
    font-size: 10px;
    color: #333;
    text-align: center;
    font-weight: 500;
}

.speech-pointer {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
}

/* Magical Sparkles */
.magical-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: sparkleAnimation 3s ease-in-out infinite;
}

.sparkle-1 {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.sparkle-2 {
    top: 30%;
    right: 20%;
    animation-delay: 0.5s;
}

.sparkle-3 {
    bottom: 40%;
    left: 15%;
    animation-delay: 1s;
}

.sparkle-4 {
    bottom: 30%;
    right: 15%;
    animation-delay: 1.5s;
}

/* Animations */
@keyframes gentleBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes eyeMovement {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-40%, -50%); }
    75% { transform: translate(-60%, -50%); }
}

@keyframes smile {
    0%, 100% { border-radius: 0 0 30px 30px; }
    50% { border-radius: 0 0 35px 35px; }
}

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

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

@keyframes rightArmMove {
    0%, 100% { transform: rotate(10deg); }
    50% { transform: rotate(5deg); }
}

@keyframes flutePlay {
    0%, 100% { transform: translateX(-50%) rotate(-15deg) scale(1); }
    50% { transform: translateX(-50%) rotate(-12deg) scale(1.05); }
}

@keyframes speechBubbleFloat {
    0%, 100% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes sparkleAnimation {
    0%, 100% { 
        opacity: 0; 
        transform: scale(0) rotate(0deg); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2) rotate(180deg); 
    }
}

/* Animation States */
.krishna-avatar.speaking .krishna-smile {
    animation: speakingSmile 0.5s ease-in-out infinite;
}

.krishna-avatar.playing-flute .left-arm {
    animation: fluteLeftArm 2s ease-in-out infinite;
}

.krishna-avatar.playing-flute .right-arm {
    animation: fluteRightArm 2s ease-in-out infinite;
}

.krishna-avatar.explaining .magical-sparkles .sparkle {
    animation-duration: 1.5s;
}

@keyframes speakingSmile {
    0%, 100% { border-radius: 0 0 30px 30px; }
    50% { border-radius: 0 0 40px 40px; }
}

@keyframes fluteLeftArm {
    0%, 100% { transform: rotate(-30deg); }
    50% { transform: rotate(-25deg); }
}

@keyframes fluteRightArm {
    0%, 100% { transform: rotate(20deg); }
    50% { transform: rotate(25deg); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .content-container {
        flex-direction: column;
    }
    
    .krishna-avatar-container {
        flex: none;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .krishna-avatar {
        width: 150px;
        height: 180px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .voice-controls {
        margin-top: 10px;
        justify-content: center;
    }
    
    /* Mobile logo adjustments */
    .header-right {
        position: static;
        margin-top: 10px;
        justify-content: center;
    }
    
    .company-logo {
        height: 50px;
    }
    
    .app-title {
        margin-right: 0;
        justify-content: center;
        flex-direction: row;
        align-items: center;
        gap: 0px;
    }
    
    .krish, .guru {
        font-size: 2rem;
        letter-spacing: 0px;
    }
    
    .krish {
        margin-right: -1px; /* Maintain seamless connection on mobile */
    }
    
    .krish::before, .guru::after {
        display: none; /* Hide emoji on mobile for cleaner look */
    }
    
    .subtitle {
        position: absolute;
        margin-top: 35px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        width: 100%;
    }
    
    header h1:not(.app-title) {
        margin-right: 0;
        text-align: center;
    }
    
    .header-left {
        text-align: center;
    }
}

/* Tab Styles */
.tab-container {
    margin-bottom: 20px;
}

.tab-navigation {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: white;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.tab-btn.active {
    background: #fff;
    color: #ff6b35;
    border-bottom-color: #ff6b35;
    font-weight: 600;
}

.tab-content {
    flex: 1;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.active {
    display: block;
}

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

/* AI Tutor Styles */
.ai-tutor-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.ai-tutor-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.ai-tutor-header h2 {
    color: #ff6b35;
    font-size: 24px;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
}

.ai-tutor-header p {
    color: #666;
    font-size: 14px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 13px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.connected {
    background: #28a745;
}

.status-indicator.disconnected {
    background: #dc3545;
}

.status-indicator.checking {
    background: #ffc107;
}

.status-text {
    font-weight: 500;
}

.status-text.connected {
    color: #28a745;
}

.status-text.disconnected {
    color: #dc3545;
}

.status-text.checking {
    color: #856404;
}

.refresh-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-left: auto;
}

.refresh-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(180deg);
}

/* AI Voice Controls */
.ai-voice-controls {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-top: 1px solid #e0e0e0;
}

.voice-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 500;
}

.voice-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.voice-toggle input:checked + .toggle-slider {
    background: #4a90e2;
}

.voice-toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 14px;
    color: #333;
}

.voice-settings {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.voice-settings label {
    color: #666;
    font-weight: 500;
}

.ai-voice-generating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 10px;
    background: #eef4ff;
    border: 1px solid #d7e3ff;
    border-radius: 10px;
    color: #1f2d4d;
    font-weight: 600;
    font-size: 13px;
}

.ai-voice-generating .spinner {
    margin-bottom: 0;
}

#aiVoiceSelector {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}

.stop-speech-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    min-width: 45px;
}

.stop-speech-btn:hover:not(:disabled) {
    background: #c82333;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.stop-speech-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.stop-speech-btn:not(:disabled) {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.6);
    }
    100% {
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    }
}

.stop-speech-btn-main {
    background: #dc3545 !important;
    color: white !important;
    border: 2px solid #dc3545 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4) !important;
    animation: pulse-red 2s infinite !important;
}

.stop-speech-btn-main:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.6) !important;
}

.stop-speech-btn-main.hidden {
    display: none !important;
}

/* Tutor Mode Controls */
.tutor-mode-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.mode-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.mode-toggle input[type="checkbox"] {
    display: none;
}

.mode-toggle input:checked + .toggle-slider {
    background: #28a745;
}

.mode-toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.mode-description {
    font-size: 12px;
    color: #666;
    margin-left: 54px;
    line-height: 1.4;
}

.mode-description .spiritual-mode {
    color: #4a90e2;
}

.mode-description .document-mode {
    color: #28a745;
}

.mode-description .hidden {
    display: none;
}

/* Language Controls */
.language-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.language-selector-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.language-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.language-selector {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.language-selector:hover {
    border-color: #4a90e2;
}

.language-selector:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.language-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4a90e2;
}

.language-description .lang-desc {
    font-style: italic;
}

.ai-krishna-avatar-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.krishna-avatar.tutor-mode {
    width: 120px;
    height: 140px;
    transform: scale(0.8);
}

.ai-krishna-avatar-container .speech-bubble {
    top: -35px;
    max-width: 200px;
}

/* Chat Interface */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    max-height: 400px;
}

.message {
    display: flex;
    margin-bottom: 15px;
    animation: messageSlideIn 0.3s ease-out;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.krishna-message .message-avatar {
    background: linear-gradient(135deg, #ff6b35, #ffd700);
    color: white;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: #4a90e2;
    color: white;
    margin-left: 10px;
    margin-right: 0;
}

.user-message .message-avatar::before {
    content: '👤';
}

.message-content {
    flex: 1;
    background: white;
    padding: 12px 15px;
    border-radius: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-message .message-content {
    background: #4a90e2;
    color: white;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
    text-align: left;
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    transition: border-color 0.3s ease;
    max-height: 100px;
    min-height: 44px;
}

#chatInput:focus {
    outline: none;
    border-color: #4a90e2;
}

.input-controls {
    display: flex;
    gap: 8px;
}

.voice-btn, .send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-btn {
    background: #28a745;
    color: white;
}

.voice-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.voice-btn.listening {
    background: #dc3545;
    animation: pulse 1s ease-in-out infinite;
}

.send-btn {
    background: #4a90e2;
    color: white;
}

.send-btn:hover {
    background: #357abd;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Voice Status */
.voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #e8f5e8;
    border-radius: 20px;
    font-size: 14px;
    color: #28a745;
}

.voice-indicator {
    font-size: 16px;
    animation: pulse 1s ease-in-out infinite;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 15px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* AI Krishna Avatar States */
.krishna-avatar.tutor-mode.thinking {
    animation: gentleThinking 2s ease-in-out infinite;
}

.krishna-avatar.tutor-mode.listening {
    animation: gentlePulse 1s ease-in-out infinite;
}

.krishna-avatar.tutor-mode.explaining .krishna-eyes {
    animation: eyeSparkle 3s ease-in-out infinite;
}

.krishna-avatar.tutor-mode.speaking {
    animation: gentleSpeaking 0.8s ease-in-out infinite;
}

.krishna-avatar.tutor-mode.speaking .krishna-mouth {
    animation: mouthMovement 0.6s ease-in-out infinite;
}

@keyframes gentleThinking {
    0%, 100% { transform: scale(0.8) rotate(-2deg); }
    50% { transform: scale(0.82) rotate(2deg); }
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(0.8); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.9; }
}

@keyframes eyeSparkle {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3) drop-shadow(0 0 5px #ffd700); }
}

@keyframes gentleSpeaking {
    0%, 100% { transform: scale(0.8); }
    50% { transform: scale(0.82); }
}

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

/* Scrollbar Styling for Chat */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Mobile Responsiveness for AI Tutor */
@media (max-width: 768px) {
    .ai-tutor-container {
        padding: 15px;
        max-height: 85vh;
    }
    
    .chat-messages {
        max-height: 300px;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .input-group {
        align-items: flex-end;
    }
    
    .voice-btn, .send-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .krishna-avatar.tutor-mode {
        width: 100px;
        height: 120px;
        transform: scale(0.7);
    }
    
    .ai-voice-controls {
        padding: 10px;
    }
    
    .voice-settings {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .voice-settings label {
        font-size: 13px;
    }
    
    #aiVoiceSelector {
        font-size: 12px;
    }
}

.gyan-wrap {
    background: linear-gradient(135deg, #f5f8ff 0%, #f9fdfc 100%);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 74, 110, 0.15);
    border: 1px solid #e4ecf5;
}

.gyan-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
    border-radius: 14px;
    background: radial-gradient(circle at 20% 20%, rgba(0, 194, 255, 0.18), transparent 35%),
                radial-gradient(circle at 80% 0%, rgba(15, 155, 142, 0.2), transparent 40%),
                linear-gradient(135deg, #0f9b8e, #0b3b5c);
    color: white;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.gyan-hero-text h2 {
    margin-bottom: 6px;
    font-size: 1.8rem;
    letter-spacing: 0.5px;
}

.gyan-hero-text p {
    margin: 0 0 10px 0;
    opacity: 0.9;
    max-width: 640px;
}

.gyan-status {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
    font-size: 0.95rem;
}

.gyan-status.success {
    background: rgba(76, 175, 80, 0.15);
    color: #e8ffe9;
}

.gyan-status.error {
    background: rgba(244, 67, 54, 0.15);
    color: #ffe6e6;
}

.gyan-status.info {
    background: rgba(255, 255, 255, 0.2);
    color: #f3fbff;
}

.gyan-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.gyan-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.gyan-loading {
    margin-top: 18px;
    text-align: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(12, 71, 124, 0.08);
    border: 1px solid #e3edf6;
}

.gyan-card {
    margin-top: 18px;
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #e1e8f2;
    box-shadow: 0 12px 26px rgba(11, 59, 92, 0.08);
}

.gyan-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0b3b5c;
    margin-bottom: 8px;
}

.gyan-card-body {
    color: #243b55;
    line-height: 1.6;
    font-size: 1rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
}

.gyan-chat {
    margin-top: 20px;
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #e1e8f2;
    box-shadow: 0 12px 28px rgba(6, 52, 95, 0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gyan-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gyan-thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f1f7ff;
    border: 1px solid #dbe8ff;
    border-radius: 10px;
    color: #234;
    font-weight: 600;
    width: fit-content;
    margin: 0 0 8px 0;
}

.gyan-thinking .spinner.small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.gyan-chat-title {
    font-weight: 700;
    color: #0b3b5c;
    font-size: 1.05rem;
}

.gyan-chat-subtitle {
    color: #4b5b73;
    font-size: 0.95rem;
}

.gyan-chat-pill {
    background: linear-gradient(135deg, #0f9b8e, #00c2ff);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.gyan-chat-messages {
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(180deg, #f7fbff 0%, #f1f5ff 100%);
    border: 1px solid #e4ebf5;
    border-radius: 12px;
    padding: 12px;
}

.gyan-message {
    display: flex;
}

.gyan-message.user {
    justify-content: flex-end;
}

.gyan-message.krishna {
    justify-content: flex-start;
}

.gyan-bubble {
    max-width: 75%;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(11, 59, 92, 0.08);
    font-size: 0.98rem;
    line-height: 1.5;
}

.gyan-message.user .gyan-bubble {
    background: linear-gradient(135deg, #0f9b8e, #00c2ff);
    color: white;
}

.gyan-message.krishna .gyan-bubble {
    background: #ffffff;
    border: 1px solid #e1e7f0;
    color: #243b55;
}

.gyan-chat-input {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.gyan-chat-input textarea {
    flex: 1;
    border: 2px solid #e1e7f0;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    color: #1f2937;
    background: #f9fbff;
}

.gyan-chat-input textarea:focus {
    outline: none;
    border-color: #0f9b8e;
    box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.15);
}

.gyan-chat-input .btn {
    height: 48px;
    padding: 0 18px;
    background: linear-gradient(135deg, #0f9b8e, #00c2ff);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 12px 22px rgba(0, 194, 255, 0.25);
}

@media (max-width: 768px) {
    .gyan-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .gyan-hero-actions {
        align-items: flex-start;
        width: 100%;
    }
    .gyan-chat-messages {
        max-height: 240px;
    }
    .gyan-bubble {
        max-width: 100%;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(255, 107, 53, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(-50%) translateX(100%);
    pointer-events: none;
}

.scroll-indicator.visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.scroll-indicator::before {
    content: "📜";
    margin-right: 5px;
}

/* Auto-scroll disabled indicator */
.auto-scroll-disabled {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

.auto-scroll-disabled.visible {
    opacity: 1;
    transform: translateY(0);
}

.auto-scroll-disabled::before {
    content: "✋";
    margin-right: 5px;
}

/* ===== AI STUDIO STYLES ===== */

.ai-studio-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.ai-studio-header {
    text-align: center;
    margin-bottom: 30px;
}

.ai-studio-header h2 {
    color: #2c3e50;
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.ai-studio-header p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.studio-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #e9ecef;
    margin: 0 auto;
    max-width: 300px;
}

.studio-status .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    animation: pulse 2s infinite;
}

.studio-status .status-indicator.ready {
    background: #28a745;
}

.studio-status .status-indicator.error {
    background: #dc3545;
}

.studio-status .status-indicator.loading {
    background: #ffc107;
}

.studio-status .status-text {
    font-weight: 500;
    color: #495057;
}

/* Model Management */
.model-management {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.model-management h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.4em;
}

.instruction-text {
    color: #6c757d;
    font-size: 0.95em;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.model-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-input-container {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.model-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.model-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.model-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.model-details span {
    padding: 8px 12px;
    background: #ffffff;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Model Download Section */
.model-download-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.model-download-section h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.model-templates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.model-template {
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
    transition: transform 0.2s, box-shadow 0.2s;
}

.model-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.model-template h5 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.model-template p {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.custom-download {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.custom-download input {
    flex: 1;
    min-width: 300px;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.9em;
}

/* Model Configuration */
.model-configuration {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.model-configuration h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

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

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9em;
}

.config-item input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.9em;
}

.config-item input[type="range"] {
    padding: 0;
}

.config-item span {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #6c757d;
}

/* Studio Chat Interface */
.studio-chat-interface {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.studio-chat-interface h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.studio-chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.studio-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.studio-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-in;
}

.studio-message.user-message {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.studio-message.assistant-message {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.studio-message .message-icon {
    font-size: 1.2em;
    min-width: 24px;
}

.studio-message .message-content {
    flex: 1;
    word-wrap: break-word;
    line-height: 1.5;
}

.system-message {
    text-align: center;
    padding: 15px;
    background: #d4edda;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    color: #155724;
    margin-bottom: 15px;
}

.studio-chat-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.studio-chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.studio-chat-input-wrapper textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    resize: vertical;
    min-height: 50px;
    max-height: 120px;
    font-family: inherit;
    font-size: 0.9em;
    transition: border-color 0.2s;
}

.studio-chat-input-wrapper textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.studio-chat-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Model Statistics */
.model-stats {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.model-stats h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-item .stat-label {
    font-weight: 500;
    color: #495057;
}

.stat-item span:last-child {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #007bff;
}

/* Studio Loading */
.studio-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.studio-loading .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.studio-loading p {
    font-size: 1.2em;
    color: #495057;
    font-weight: 500;
}

/* Button Styles for AI Studio */
.ai-studio-container .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.ai-studio-container .btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.ai-studio-container .btn.primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.ai-studio-container .btn.danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.ai-studio-container .btn.danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.ai-studio-container .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.auth-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fbff 100%);
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    color: #1e3c72;
}

.card-header p {
    margin: 4px 0 0 0;
    color: #64748b;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pill {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #ffffff;
}

.pill.muted {
    background: #f1f5f9;
    color: #475569;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-weight: 600;
    color: #334155;
}

.form-field input {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    transition: all 0.2s ease;
}

.form-field input:focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
    outline: none;
}

.full-width {
    width: 100%;
    margin-top: 8px;
}

.auth-card .btn.primary {
    width: 100%;
}

.logs-card {
    margin-top: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.log-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logs-table table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th,
.logs-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.logs-table th {
    color: #1e3c72;
    background: #f8fafc;
    font-weight: 700;
}

.logs-table .empty-state td {
    text-align: center;
    color: #94a3b8;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.btn.danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: #ffffff;
}

.btn.danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.session-summary {
    margin-top: 16px;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    background: #f8fafc;
    display: grid;
    gap: 8px;
}

.session-row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #1f2937;
}

.session-row span:last-child {
    font-weight: 500;
    color: #0f172a;
}

/* Responsive Design */
.student-page {
    background: radial-gradient(circle at 10% 20%, rgba(255, 214, 165, 0.35), transparent 30%),
                radial-gradient(circle at 80% 0%, rgba(134, 239, 172, 0.35), transparent 25%),
                radial-gradient(circle at 20% 80%, rgba(147, 197, 253, 0.35), transparent 28%),
                #f6f8fb;
    min-height: 100vh;
}

.student-hero {
    background: linear-gradient(120deg, #1e3c72, #2a5298);
    color: #f8fafc;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.student-hero .eyebrow,
.student-hero p,
.student-hero h1 {
    color: #f8fafc;
}

.student-auth-card {
    max-width: 560px;
    margin: 16px auto 0 auto;
    border: 1px solid #e0e7ff;
    box-shadow: 0 20px 50px rgba(30, 60, 114, 0.12);
    background: linear-gradient(135deg, #ffffff 0%, #f7f9ff 100%);
    position: relative;
    overflow: hidden;
}

.student-auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(46, 204, 113, 0.12), transparent 45%),
                radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.12), transparent 50%);
    pointer-events: none;
}

.student-auth-card .card-header h2 {
    color: #1e3c72;
}

.student-auth-card .btn.primary {
    box-shadow: 0 10px 20px rgba(255, 107, 53, 0.25);
}

.main-logout-btn {
    margin-top: 10px;
    align-self: flex-start;
    padding: 8px 14px;
}

@media (max-width: 768px) {
    .ai-studio-container {
        padding: 15px;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .model-templates {
        grid-template-columns: 1fr;
    }
    
    .file-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .custom-download {
        flex-direction: column;
        align-items: stretch;
    }
    
    .custom-download input {
        min-width: auto;
    }
    
    .studio-chat-input-wrapper {
        flex-direction: column;
    }
    
    .studio-chat-controls {
        justify-content: center;
    }
}

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

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

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