/* PROFESSIONAL BOARD GAME CANDYLAND SYSTEM STYLES */
/* Maintains original system's sophisticated medical education platform aesthetics */

/* Foundation - Professional Background System (from original) */
.professional-board-game {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    min-height: 100vh;
}

/* Professional Board Game Header (inspired by original header styling) */
.board-game-header {
    text-align: center;
    background: #fefcf3;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 
        0 20px 60px rgba(107, 159, 120, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out;
}

.board-game-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 3s infinite;
}

.board-game-header h2 {
    color: #4a6d52;
    font-size: 2.8em;
    margin-bottom: 15px;
    font-weight: 800;
    text-shadow: none;
    position: relative;
    z-index: 2;
}

/* Professional Progress Indicator */
.progress-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.progress-text {
    color: #6b9f78;
    font-size: 1.1em;
    font-weight: 600;
}

.progress-bar {
    width: 300px;
    height: 8px;
    background: rgba(107, 159, 120, 0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6b9f78, #f59e0b);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressGlow 2s ease-in-out infinite alternate;
}

/* Board Game Canvas */
.board-game-canvas {
    position: relative;
    background: 
        radial-gradient(circle at 25% 25%, rgba(107, 159, 120, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
    border-radius: 20px;
    margin-bottom: 120px; /* Space for ERNEST dialogue */
    overflow: visible;
    min-height: 600px;
}

/* SVG Path Styling */
.pathway-connections {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

/* Module Squares Container */
.module-squares-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Professional Board Square (inspired by original module cards) */
.professional-board-square {
    position: absolute;
    width: 80px;
    height: 80px;
    background: #fefcf3;
    border: 2px solid rgba(107, 159, 120, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(107, 159, 120, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateZ(0); /* GPU acceleration */
    backface-visibility: hidden;
}

.professional-board-square:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(107, 159, 120, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: #6b9f78;
    z-index: 100;
}

/* Square Glow Effect */
.square-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(107, 159, 120, 0.3), rgba(245, 158, 11, 0.2));
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.professional-board-square:hover .square-glow {
    opacity: 1;
    animation: pulseGlow 1.5s ease-in-out infinite;
}

/* Square Content Layout */
.square-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
}

.module-number-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #6b9f78, #4a6d52);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #fefcf3;
}

.module-icon {
    font-size: 1.8em;
    margin-bottom: 2px;
}

.module-title-short {
    font-size: 8px;
    font-weight: 600;
    color: #4a6d52;
    line-height: 1.1;
    max-height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.status-indicator {
    position: absolute;
    bottom: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 2px solid;
}

.status-indicator .status-icon {
    font-size: 10px;
}

.difficulty-stars {
    position: absolute;
    top: -8px;
    left: -8px;
    font-size: 8px;
    background: rgba(245, 158, 11, 0.9);
    color: white;
    padding: 2px 4px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Status-based styling */
.professional-board-square.completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    border-color: #10b981;
}

.professional-board-square.completed .status-indicator {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.professional-board-square.current {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.1) 100%);
    border-color: #f59e0b;
    animation: currentPulse 2s ease-in-out infinite;
}

.professional-board-square.current .status-indicator {
    border-color: #f59e0b;
    background: #f59e0b;
    color: white;
}

.professional-board-square.available {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    border-color: #3b82f6;
}

.professional-board-square.available .status-indicator {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
}

.professional-board-square.locked {
    background: rgba(156, 163, 175, 0.1);
    border-color: #9ca3af;
    opacity: 0.6;
    cursor: not-allowed;
}

.professional-board-square.locked:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(107, 159, 120, 0.15);
}

.professional-board-square.locked .status-indicator {
    border-color: #9ca3af;
    background: #9ca3af;
    color: white;
}

/* Content Available Indicator - Red Dot */
.content-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.6);
    z-index: 100;
    animation: contentPulse 2s ease-in-out infinite;
}

@keyframes contentPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Hover Detail Panel */
.module-detail-panel {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fefcf3;
    border: 1px solid rgba(107, 159, 120, 0.3);
    border-radius: 12px;
    padding: 15px;
    width: 250px;
    box-shadow: 
        0 10px 30px rgba(107, 159, 120, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 10px;
}

.professional-board-square:hover .module-detail-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.module-detail-panel h4 {
    color: #4a6d52;
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.module-detail-panel .competency {
    color: #6b9f78;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.module-detail-panel .description {
    color: #4a5568;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 10px;
}

.status-badge-detail {
    background: linear-gradient(135deg, #6b9f78, #4a6d52);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
}

/* PROFESSIONAL ERNEST DIALOGUE SYSTEM */
.professional-ernest-dialogue {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.professional-ernest-dialogue.dialogue-visible {
    opacity: 1;
}

.dialogue-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

.dialogue-container {
    background: #fefcf3;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px 25px 0 0;
    box-shadow: 
        0 -20px 60px rgba(107, 159, 120, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    max-width: 800px;
    width: 90%;
    padding: 30px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.professional-ernest-dialogue.dialogue-visible .dialogue-container {
    transform: translateY(0);
}

/* ERNEST Professional Avatar */
.ernest-avatar-container {
    flex-shrink: 0;
}

.ernest-professional-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6b9f78, #4a6d52);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 
        0 8px 25px rgba(107, 159, 120, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.avatar-glow {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, rgba(107, 159, 120, 0.4), rgba(245, 158, 11, 0.3));
    border-radius: 50%;
    animation: avatarGlow 2s ease-in-out infinite alternate;
    z-index: -1;
}

.avatar-character {
    font-size: 2.5em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Dialogue Content */
.dialogue-content-container {
    flex: 1;
}

.speaker-label {
    color: #4a6d52;
    font-size: 0.9em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.dialogue-message {
    color: #1f2937;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.dialogue-message strong {
    color: #4a6d52;
    font-weight: 700;
}

/* Professional Dialogue Button */
.professional-dialogue-btn {
    background: linear-gradient(135deg, #6b9f78, #4a6d52);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(107, 159, 120, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.professional-dialogue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(107, 159, 120, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #4a6d52, #6b9f78);
}

/* Animations */
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

@keyframes progressGlow {
    0% { box-shadow: 0 0 5px rgba(107, 159, 120, 0.3); }
    100% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
}

@keyframes currentPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5); }
}

@keyframes avatarGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .professional-board-game {
        padding: 15px;
    }
    
    .board-game-header {
        padding: 25px;
    }
    
    .board-game-header h2 {
        font-size: 2.2em;
    }
    
    .professional-board-square {
        width: 70px;
        height: 70px;
    }
    
    .module-detail-panel {
        width: 200px;
    }
    
    .dialogue-container {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .progress-bar {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .professional-board-square {
        width: 60px;
        height: 60px;
    }
    
    .module-icon {
        font-size: 1.5em;
    }
    
    .module-title-short {
        font-size: 7px;
    }
}