/**
 * Oracle Junior - Kids Platform Theme
 * Bright, colorful, fun styling for children
 * DESKTOP ONLY - hidden on mobile/iOS
 */

/* Hide Junior UI on mobile */
@media (max-width: 1024px) {
    .junior-dashboard,
    .oracle-junior-mode .junior-dashboard {
        display: none !important;
    }
}

/* Junior Mode - Hide adult UI */
.oracle-junior-mode #sidebar,
.oracle-junior-mode #topbar,
.oracle-junior-mode #mainFeed,
.oracle-junior-mode #mobileQuickbar,
.oracle-junior-mode .chat-container {
    display: none !important;
}

/* Junior Dashboard Container */
.junior-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f8f0ff 0%, #e8f4ff 50%, #fff0f8 100%);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    font-family: 'Nunito', 'Inter', sans-serif;
    overflow-y: auto;
}

/* Header */
.junior-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 3px solid #e0d0f0;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.1);
}

.junior-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.junior-rainbow-text {
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.junior-header-actions {
    display: flex;
    gap: 10px;
}

.junior-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e0d0f0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #8B5CF6;
}

.junior-btn-icon:hover {
    background: #8B5CF6;
    color: white;
    transform: scale(1.1);
}

/* Content */
.junior-content {
    flex: 1;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Greeting Bubble */
.junior-greeting-bubble {
    background: white;
    border-radius: 20px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
    margin-bottom: 30px;
    border: 2px solid #e0d0f0;
}

.character-emoji {
    font-size: 2.5rem;
}

#greetingText {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
}

/* Voice Section */
.junior-voice-section {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.junior-voice-btn {
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    border: none;
    border-radius: 20px;
    padding: 25px 50px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.junior-voice-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
}

.voice-btn-icon {
    font-size: 2.5rem;
}

.voice-btn-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

.voice-btn-subtext {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Feature Grid */
.junior-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.junior-feature-card {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e0d0f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.junior-feature-card:hover {
    transform: translateY(-5px);
    border-color: #8B5CF6;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
}

.junior-feature-card.roblox {
    background: linear-gradient(135deg, #fff0f0 0%, #ffe8e8 100%);
    border-color: #ff9999;
}

.junior-feature-card.roblox:hover {
    border-color: #ff6666;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.feature-desc {
    font-size: 0.8rem;
    color: #666;
}

/* Character Switcher */
.junior-character-switcher {
    background: white;
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid #e0d0f0;
}

.switcher-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.character-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.character-option {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: 2px solid #e0d0f0;
    background: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s;
}

.character-option:hover {
    border-color: #8B5CF6;
    transform: scale(1.1);
}

.character-option.active {
    border-color: #8B5CF6;
    background: linear-gradient(135deg, #f5e8ff 0%, #e8f4ff 100%);
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

/* Overlays */
.junior-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.junior-panel {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.junior-panel.wide {
    max-width: 700px;
}

.junior-panel-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    background: linear-gradient(135deg, #f8f0ff 0%, #e8f4ff 100%);
    border-radius: 24px 24px 0 0;
}

.junior-panel-header.roblox-header {
    background: linear-gradient(135deg, #fff0f0 0%, #ffe8e8 100%);
}

.junior-panel-header.homework-header {
    background: linear-gradient(135deg, #f0fff4 0%, #e8fff0 100%);
}

.junior-panel-header.art-header {
    background: linear-gradient(135deg, #fff8e8 0%, #fff0e0 100%);
}

.junior-panel-header.story-header {
    background: linear-gradient(135deg, #e8f8ff 0%, #e0f0ff 100%);
}

.junior-panel-header.fun-header {
    background: linear-gradient(135deg, #fff0ff 0%, #ffe8ff 100%);
}

.junior-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.junior-close-btn:hover {
    background: #ff6b6b;
    color: white;
}

.junior-panel-content {
    padding: 25px;
}

/* Chat Styles */
.junior-chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 12px;
    margin-bottom: 15px;
}

.junior-message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-start;
}

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

.junior-message .message-emoji {
    font-size: 1.5rem;
}

.junior-message .message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.junior-message.user .message-text {
    background: #8B5CF6;
    color: white;
}

.junior-message.buddy .message-text {
    background: white;
    border: 2px solid #e0d0f0;
}

.junior-message.typing .message-text {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.junior-chat-input {
    display: flex;
    gap: 10px;
}

.junior-chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0d0f0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.junior-chat-input input:focus {
    border-color: #8B5CF6;
}

.junior-chat-input button {
    padding: 12px 24px;
    background: #8B5CF6;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.junior-chat-input button:hover {
    background: #7c3aed;
}

/* Primary Button */
.junior-primary-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
}

.junior-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.junior-secondary-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.junior-secondary-btn:hover {
    background: #e0e0e0;
}

/* Roblox Builder Styles */
.roblox-intro {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff0f0;
    border-radius: 12px;
}

.roblox-templates h3,
.roblox-custom h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.template-card {
    background: white;
    border: 2px solid #e0d0f0;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover {
    border-color: #ff6666;
    transform: scale(1.05);
}

.template-emoji {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 5px;
}

.template-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
}

.roblox-custom textarea,
.homework-question textarea,
.art-prompt textarea {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 2px solid #e0d0f0;
    border-radius: 12px;
    font-size: 1rem;
    resize: none;
    outline: none;
    font-family: inherit;
}

.roblox-custom textarea:focus,
.homework-question textarea:focus,
.art-prompt textarea:focus {
    border-color: #8B5CF6;
}

.build-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.building-animation {
    font-size: 1.2rem;
    animation: pulse 1s infinite;
}

.build-success {
    background: #e8fff0;
    color: #10B981;
    padding: 20px;
    border-radius: 12px;
}

/* Homework Helper Styles */
.homework-intro {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f0fff4;
    border-radius: 12px;
}

.homework-upload {
    margin-bottom: 20px;
}

.upload-btn {
    width: 100%;
    padding: 30px;
    background: #f8f8f8;
    border: 3px dashed #ccc;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn:hover {
    border-color: #8B5CF6;
    background: #f8f0ff;
}

.image-preview {
    margin-top: 15px;
}

.image-preview img {
    max-width: 100%;
    border-radius: 12px;
}

.subject-buttons,
.style-buttons,
.genre-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.subject-btn,
.style-btn,
.genre-btn {
    padding: 10px 15px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.subject-btn:hover,
.style-btn:hover,
.genre-btn:hover {
    background: #e0e0e0;
}

.subject-btn.active,
.style-btn.active,
.genre-btn.active {
    background: #8B5CF6;
    color: white;
}

.homework-response,
.story-result,
.art-result,
.fun-result {
    margin-top: 20px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 12px;
}

.loading {
    text-align: center;
    font-size: 1.1rem;
    animation: pulse 1s infinite;
}

.homework-answer {
    display: flex;
    gap: 15px;
}

.answer-emoji {
    font-size: 2rem;
}

.answer-text {
    flex: 1;
    line-height: 1.6;
}

/* Story Time Styles */
.story-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.story-option-btn {
    flex: 1;
    padding: 20px;
    background: white;
    border: 2px solid #e0d0f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.story-option-btn:hover {
    border-color: #8B5CF6;
    transform: translateY(-3px);
}

.option-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.option-title {
    font-weight: 700;
    display: block;
}

.option-desc {
    font-size: 0.8rem;
    color: #666;
}

.story-content {
    line-height: 1.8;
}

.story-text {
    white-space: pre-wrap;
    margin-bottom: 15px;
}

/* Fun Zone Styles */
.fun-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.fun-option-btn {
    padding: 20px 15px;
    background: white;
    border: 2px solid #e0d0f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.fun-option-btn:hover {
    border-color: #8B5CF6;
    transform: scale(1.05);
}

.joke-card,
.riddle-card,
.trivia-card,
.wyr-card,
.magic8-card {
    text-align: center;
}

.joke-question,
.riddle-question,
.trivia-question {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.reveal-btn {
    padding: 12px 24px;
    background: #FBBF24;
    color: #333;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reveal-btn:hover {
    background: #F59E0B;
}

.joke-answer,
.riddle-answer {
    font-size: 1.3rem;
    font-weight: 700;
    color: #8B5CF6;
    margin: 15px 0;
}

.trivia-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.trivia-option {
    padding: 12px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.trivia-option:hover:not(:disabled) {
    background: #e0e0e0;
}

.trivia-option.correct {
    background: #10B981;
    color: white;
}

.trivia-option.wrong {
    background: #EF4444;
    color: white;
}

.correct-feedback {
    color: #10B981;
    font-weight: 600;
}

.wrong-feedback {
    color: #EF4444;
}

.wyr-options {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.wyr-option {
    flex: 1;
    padding: 20px;
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.wyr-option:hover {
    transform: scale(1.05);
}

.wyr-option.selected {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

.wyr-or {
    font-weight: 700;
    color: #666;
}

.magic8-card input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0d0f0;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 15px;
}

.magic8-result {
    font-size: 1.5rem;
    font-weight: 700;
    color: #8B5CF6;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f0ff 0%, #e8f4ff 100%);
    border-radius: 12px;
}

.shaking {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Voice Mode Styles */
.junior-voice-mode {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.voice-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.voice-character {
    text-align: center;
    margin-bottom: 40px;
}

.voice-avatar {
    font-size: 5rem;
    margin-bottom: 15px;
}

.voice-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.voice-status {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.voice-record-btn {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
}

.voice-record-btn:hover {
    transform: scale(1.05);
}

.voice-record-btn.recording {
    background: #EF4444;
    animation: pulse-recording 1s infinite;
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
}

.record-icon {
    font-size: 3rem;
}

.record-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    margin-top: 5px;
}

.voice-character-switcher {
    display: flex;
    gap: 10px;
    margin-top: 40px;
}

.voice-char-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.voice-char-btn:hover {
    border-color: white;
    transform: scale(1.1);
}

.voice-char-btn.active {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.3);
}

/* Notification */
.junior-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    z-index: 11000;
    transition: transform 0.3s;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.junior-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* Error and success states */
.error {
    color: #EF4444;
    padding: 10px;
    background: #FEE2E2;
    border-radius: 8px;
    margin-top: 10px;
}

/* Responsive for smaller desktops */
@media (max-width: 1200px) {
    .junior-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .fun-options {
        grid-template-columns: repeat(2, 1fr);
    }
}
