/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', cursive;
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f8ff 50%, #e6f3ff 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    position: relative;
}

/* Hospital-themed background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(0, 120, 215, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(107, 91, 149, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(102, 187, 106, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Subtle medical cross pattern */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 100px,
            rgba(0, 120, 215, 0.01) 100px,
            rgba(0, 120, 215, 0.01) 102px
        );
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1, h2, h3 {
    color: #0078d7;
    margin-bottom: 15px;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.4rem;
    color: #6b5b95;
}

p {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* Header */
header {
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 120, 215, 0.15);
    margin-bottom: 30px;
    border: 2px solid rgba(0, 120, 215, 0.1);
    position: relative;
}

/* Medical cross accent */
header::before {
    content: '✚';
    position: absolute;
    top: 10px;
    right: 20px;
    color: rgba(0, 120, 215, 0.2);
    font-size: 1.5rem;
    font-weight: bold;
}

header h2 {
    color: #6b5b95;
}

/* Avatar Creator */
.character-selection {
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 120, 215, 0.15);
    margin-bottom: 30px;
    border: 2px solid rgba(0, 120, 215, 0.1);
    position: relative;
}

/* Stethoscope accent */
.character-selection::before {
    content: '🩺';
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 1.2rem;
    opacity: 0.3;
}

.avatar-creator {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.avatar-preview {
    flex: 0 0 300px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-container {
    width: 200px;
    height: 300px;
    position: relative;
    margin-bottom: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.avatar-base, .avatar-skin, .avatar-face, .avatar-hair, .avatar-tops, .avatar-pants, .avatar-shoes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.avatar-name-container {
    width: 100%;
    margin-top: 10px;
}

#avatar-name {
    width: 100%;
    padding: 10px;
    border: 2px solid #0078d7;
    border-radius: 25px;
    font-family: 'Comic Neue', cursive;
    font-size: 1.1rem;
    text-align: center;
}

.avatar-options {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.option-section {
    margin-bottom: 20px;
    background-color: #f8f8f8;
    border-radius: 15px;
    padding: 15px;
}

.option-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.option-item {
    cursor: pointer;
    width: 90px;
    height: 100px;
    border: 3px solid #ddd;
    border-radius: 10px;
    overflow: visible;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 5px;
    background-color: #ffffff;
}

.option-item:hover {
    transform: scale(1.05);
    border-color: #0078d7;
}

.option-item.selected {
    border-color: #0078d7;
    box-shadow: 0 0 10px rgba(0, 120, 215, 0.5);
}

.option-item img {
    max-width: 100%;
    max-height: 55px;
    object-fit: contain;
    flex-shrink: 0;
}

.option-item p {
    margin-top: 5px;
    margin-bottom: 0;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.gender-options {
    justify-content: center;
}

.avatar-actions {
    width: 100%;
    margin-top: 20px;
    text-align: center;
}

#create-buddy-btn {
    padding: 15px 30px;
    font-size: 1.3rem;
    background-color: #66bb6a;
}

#create-buddy-btn:hover {
    background-color: #4caf50;
}

/* Main Content */
.main-content {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Journey Map */
.journey-map {
    text-align: center;
    margin-bottom: 30px;
}

.map-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    position: relative;
    padding: 0 20px;
}

.map-container::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 10%;
    right: 10%;
    height: 6px;
    background-color: #0078d7;
    z-index: 0;
    border-radius: 3px;
}

.map-stage {
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 22%;
}

.map-stage:hover {
    transform: scale(1.05);
}

.stage-icon {
    width: 60px;
    height: 60px;
    background-color: #0078d7;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 10px;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.map-stage.active .stage-icon {
    background-color: #6b5b95;
}

.map-stage p {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Stage Content */
.stage-content {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 15px;
}

.info-section {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.info-text {
    flex: 1;
}

.info-image {
    flex: 1;
    text-align: center;
}

.info-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Chemo Info Section */
.chemo-info-section {
    background-color: #f0f7ff;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.chemo-info-section h3 {
    color: #0078d7;
    margin-bottom: 15px;
}

.chemo-info-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid #0078d7;
    border-radius: 10px;
    font-family: 'Comic Neue', cursive;
    font-size: 1.1rem;
    margin-top: 10px;
    margin-bottom: 20px;
    background-color: white;
    cursor: pointer;
}

.chemo-info-section select:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 120, 215, 0.5);
}

#chemo-details {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#chemo-details h4 {
    color: #0078d7;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.chemo-description {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chemo-what-it-does, .chemo-side-effects {
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 10px;
}

.chemo-what-it-does h5, .chemo-side-effects h5 {
    color: #6b5b95;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.chemo-what-it-does {
    border-left: 5px solid #66bb6a;
}

.chemo-side-effects {
    border-left: 5px solid #ff9800;
}

/* Interactive Elements */
.interactive-element {
    background-color: #e6f7ff;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.drag-drop-game, .game-container, .recovery-game, .routine-planner {
    min-height: 200px;
    border: 3px dashed #0078d7;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    background-color: #ffffff;
}

/* Buddy Container */
.buddy-container {
    display: flex;
    align-items: center;
    margin-top: 30px;
    background-color: #f0f0f0;
    border-radius: 15px;
    padding: 15px;
}

.buddy-character {
    flex: 0 0 150px;
}

.buddy-character img {
    width: 100%;
    height: auto;
}

.buddy-speech {
    flex: 1;
    background-color: #ffffff;
    border-radius: 15px;
    padding: 15px;
    margin-left: 15px;
    position: relative;
}

.buddy-speech::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 30px;
    border-width: 15px 15px 15px 0;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
}

/* Achievements */
.achievements {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.badge {
    width: 120px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.badge:hover {
    transform: scale(1.05);
}

.badge img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.badge p {
    font-weight: bold;
    font-size: 1rem;
}

.badge.locked {
    opacity: 0.5;
}

/* Feelings Tracker */
.feelings-tracker {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

.feelings-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.feeling {
    width: 100px;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 10px;
    border-radius: 10px;
}

.feeling:hover {
    transform: scale(1.05);
    background-color: #f0f0f0;
}

.feeling-emoji {
    font-size: 3.5rem;
    margin-bottom: 5px;
}

.feeling p {
    font-weight: bold;
    margin-bottom: 0;
}

.feeling-response {
    margin-top: 30px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 10px;
    min-height: 80px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
}

.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

button {
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
    box-shadow: 0 4px 8px rgba(0, 120, 215, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

button:hover {
    background: linear-gradient(135deg, #005a9e 0%, #004080 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 120, 215, 0.4);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 120, 215, 0.3);
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .info-section {
        flex-direction: column;
    }
    
    .map-container {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .map-container::before {
        top: 0;
        bottom: 0;
        left: 50%;
        right: auto;
        width: 6px;
        height: auto;
        opacity: 0.2;
    }
    
    .map-stage {
        width: 80%;
    }
    
    .characters {
        flex-direction: column;
        align-items: center;
    }
    
    .buddy-container {
        flex-direction: column;
    }
    
    .buddy-speech {
        margin-left: 0;
        margin-top: 15px;
    }
    
    .buddy-speech::before {
        left: 50%;
        top: -15px;
        transform: translateX(-50%);
        border-width: 0 15px 15px 15px;
        border-color: transparent transparent #ffffff transparent;
    }
}

/* Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Game-specific styles */
.draggable {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    padding: 15px 20px;
    margin: 8px;
    background-color: #e6f7ff;
    border-radius: 10px;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: bold;
    border: 2px solid #0078d7;
    touch-action: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 100px;
    text-align: center;
}

.draggable:active {
    cursor: grabbing;
}

.draggable:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 120, 215, 0.3);
}

.draggable.dragging {
    opacity: 0.5;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 120, 215, 0.4);
    z-index: 100;
}

/* Touch-specific styles */
@media (hover: none) and (pointer: coarse) {
    .draggable {
        padding: 20px 25px;
        font-size: 1.2rem;
        min-width: 120px;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.dropzone {
    border: 2px dashed #0078d7;
    border-radius: 8px;
    padding: 15px;
    min-height: 100px;
    margin: 10px 0;
    background-color: #f8f8f8;
}

.dropzone.highlight {
    background-color: #e6f7ff;
}

.game-object {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.game-object:hover {
    transform: scale(1.1);
}

.cell {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: absolute;
    transition: all 0.5s ease;
}

.medicine {
    background-color: #0078d7;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    position: absolute;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    touch-action: none;
}

.medicine::after {
    content: "medicine";
    pointer-events: none;
}

.sick-cell {
    background-color: #ff6b6b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
    border: 2px solid #ff5252;
    touch-action: none;
}

.healthy-cell {
    background-color: #66bb6a;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(102, 187, 106, 0.3);
    border: 2px solid #4caf50;
    touch-action: none;
}

/* Responsive Medicine Game Scaling */
#medicine-game .game-area {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 5 / 3;
    height: auto !important;
    min-height: 250px;
    position: relative;
}

@media (max-width: 768px) {
    #medicine-game .game-area {
        min-height: 200px;
    }
    
    .medicine {
        width: 50px;
        height: 50px;
        font-size: 0.75rem;
    }
    
    .sick-cell,
    .healthy-cell {
        width: 32px;
        height: 32px;
    }
    
    .cell-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    #medicine-game .game-area {
        min-height: 180px;
    }
    
    .medicine {
        width: 40px;
        height: 40px;
        font-size: 0.65rem;
    }
    
    .sick-cell,
    .healthy-cell {
        width: 28px;
        height: 28px;
    }
    
    .cell-label {
        font-size: 0.65rem;
    }
    
    .game-instructions p {
        font-size: 1rem;
    }
}

.moving-cell {
    transition: none !important;
    animation: none !important;
}

.moving-cell:hover {
    transform: none !important;
}

/* Add subtle pulsing animation to cells */
@keyframes cellPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.sick-cell.moving-cell {
    animation: cellPulse 2s ease-in-out infinite;
}

.healthy-cell.moving-cell {
    animation: cellPulse 2.5s ease-in-out infinite;
}

.cell-label {
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.routine-item {
    background-color: #f0f0f0;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.routine-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.routine-item label {
    flex: 1;
    margin-left: 10px;
    font-size: 1.1rem;
}

.time-select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-family: 'Comic Neue', cursive;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 0 10px;
}

.navigation-buttons.top {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.navigation-buttons.bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.nav-btn {
    background-color: #0078d7;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.nav-btn:hover:not(:disabled) {
    background-color: #005a9e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 120, 215, 0.3);
}

.nav-btn:disabled {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nav-btn.back-btn {
    background-color: #6b5b95;
}

.nav-btn.back-btn:hover:not(:disabled) {
    background-color: #5a4a85;
}

.nav-btn.next-btn {
    background-color: #66bb6a;
}

.nav-btn.next-btn:hover:not(:disabled) {
    background-color: #4caf50;
}

/* Activity completion indicators */
.activity-complete {
    border: 3px solid #66bb6a !important;
    background-color: #e8f5e8 !important;
}

.activity-complete::after {
    content: "✓";
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #66bb6a;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.stage-complete .stage-icon {
    background-color: #66bb6a !important;
}

.stage-complete .stage-icon::after {
    content: "✓";
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #4caf50;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

/* Persistent Floating Buddy */
.floating-buddy {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 150px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none; /* Hidden until buddy is created */
}

.floating-buddy.visible {
    display: block;
}

.floating-buddy:hover {
    transform: scale(1.05);
}

.floating-buddy-character {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 120, 215, 0.3);
    border: 3px solid rgba(0, 120, 215, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.floating-buddy-avatar {
    width: 80px;
    height: 100px;
    position: relative;
}

.floating-buddy-avatar .avatar-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.floating-buddy-name {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 120, 215, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-buddy-speech {
    position: absolute;
    bottom: 160px;
    right: 0;
    width: 250px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 120, 215, 0.2);
    border: 2px solid rgba(0, 120, 215, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(10px);
}

.floating-buddy-speech.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-buddy-speech::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    border-width: 10px 10px 0 10px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

.floating-buddy-speech p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    color: #333;
}

/* Buddy animation states */
.floating-buddy.talking .floating-buddy-character {
    animation: buddyTalk 0.5s ease-in-out;
}

.floating-buddy.happy .floating-buddy-character {
    animation: buddyBounce 0.6s ease-in-out;
}

.floating-buddy.thinking .floating-buddy-character {
    animation: buddyThink 1s ease-in-out infinite;
}

@keyframes buddyTalk {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes buddyBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-5px); }
    50% { transform: translateY(-10px); }
    75% { transform: translateY(-5px); }
}

@keyframes buddyThink {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

/* Buddy interaction button */
.buddy-interaction-btn {
    position: absolute;
    top: -15px;
    left: -15px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(102, 187, 106, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    z-index: 10;
}

.buddy-interaction-btn::before {
    content: '💬';
    font-size: 1rem;
}

.buddy-interaction-btn::after {
    content: 'Chat';
}

.buddy-interaction-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(102, 187, 106, 0.5);
}

/* Buddy edit button */
.buddy-edit-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    z-index: 10;
}

.buddy-edit-btn::before {
    content: '✏️';
    font-size: 1rem;
}

.buddy-edit-btn::after {
    content: 'Edit';
}

.buddy-edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(255, 152, 0, 0.5);
}

/* Responsive adjustments for floating buddy */
@media (max-width: 768px) {
    .floating-buddy {
        bottom: 80px; /* Above mobile navigation */
        right: 15px;
        width: 100px;
        height: 125px;
    }
    
    .floating-buddy-character {
        height: 100px;
    }
    
    .floating-buddy-avatar {
        width: 70px;
        height: 85px;
    }
    
    .floating-buddy-speech {
        width: 200px;
        bottom: 135px;
        right: -50px;
    }
    
    .floating-buddy-name {
        font-size: 0.8rem;
        padding: 3px 10px;
    }
}

/* Hide original buddy container when floating buddy is active */
.floating-buddy.visible ~ .main-content .buddy-container {
    display: none;
}

/* Login Screen Styles */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.login-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 24px rgba(0, 120, 215, 0.2);
    border: 3px solid rgba(0, 120, 215, 0.1);
    max-width: 450px;
    width: 100%;
    position: relative;
}

.login-container::before {
    content: '🏥';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    opacity: 0.2;
}

.login-container h2 {
    text-align: center;
    color: #0078d7;
    margin-bottom: 10px;
    font-size: 2rem;
}

.login-subtitle {
    text-align: center;
    color: #6b5b95;
    font-size: 1rem;
    margin-bottom: 30px;
}

.login-form,
.signup-form {
    width: 100%;
}

.login-form h3,
.signup-form h3 {
    text-align: center;
    color: #6b5b95;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'Comic Neue', cursive;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #0078d7;
    box-shadow: 0 0 8px rgba(0, 120, 215, 0.2);
}

.form-group input[type="text"] {
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 0.3em;
    font-weight: bold;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.3);
    margin-top: 10px;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 187, 106, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

.form-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 1rem;
    color: #666;
}

.form-switch a {
    color: #0078d7;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.form-switch a:hover {
    color: #005a9e;
    text-decoration: underline;
}

.auth-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.auth-message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #66bb6a;
}

.auth-message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 2px solid #ef5350;
}

.auth-message:empty {
    display: none;
}

.error-message {
    display: none;
    color: #c62828;
    background-color: #ffebee;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: bold;
    text-align: center;
    border: 2px solid #ef5350;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f7ff;
    border-radius: 10px;
    border: 2px solid rgba(0, 120, 215, 0.2);
    text-align: center;
}

.login-info p {
    margin: 0;
    color: #0078d7;
    font-size: 0.95rem;
    font-weight: bold;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c92a2a 0%, #a61e1e 100%);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.4);
}

.primary-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #0078d7 0%, #005a9e 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
    box-shadow: 0 4px 12px rgba(0, 120, 215, 0.3);
    margin-top: 10px;
}

.primary-btn:hover {
    background: linear-gradient(135deg, #005a9e 0%, #004080 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 120, 215, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Responsive login styles */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
    }
    
    .login-container h2 {
        font-size: 1.6rem;
    }
    
    .form-group input[type="text"] {
        font-size: 1.2rem;
    }
    
    .logout-btn {
        position: static;
        width: 100%;
        margin-top: 10px;
    }
}

/* Superhero Challenge Game Styles */
#superhero-game-area {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 300px;
    border: 3px solid #2196F3;
    border-radius: 15px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    margin: 20px auto;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    touch-action: none;
}

.superhero-player {
    position: absolute;
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #FF9800, #F57C00);
    border: 3px solid #E65100;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.1s ease;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.6);
    touch-action: none;
}

.superhero-player::before {
    content: '🦸';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 10px;
    border: 2px solid #ddd;
}

.stat {
    font-weight: bold;
    color: #333;
    padding: 5px 10px;
    background-color: white;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.game-controls {
    text-align: center;
    margin: 20px 0;
}

.game-controls button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
    margin: 0 10px;
}

.game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

.game-controls button:active {
    transform: translateY(0);
}

#reset-challenge {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

#reset-challenge:hover {
    box-shadow: 0 6px 12px rgba(255, 152, 0, 0.4);
}

.game-instructions h4 {
    color: #2196F3;
    margin-bottom: 10px;
    font-size: 18px;
}

.game-instructions p {
    margin: 5px 0;
    color: #555;
}

#superhero-feedback {
    font-weight: bold;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background-color: #f0f8ff;
    border: 2px solid #2196F3;
    margin-top: 15px;
}

.power-up {
    animation: pulse 1s infinite;
}

.obstacle {
    animation: pulse 1.5s infinite;
}

/* Mobile controls for superhero game */
.mobile-controls {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 20px auto;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 15px;
    border: 2px solid #ddd;
}

.mobile-control-btn {
    padding: 20px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(33, 150, 243, 0.3);
    touch-action: manipulation;
    user-select: none;
}

.mobile-control-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.mobile-control-btn.empty {
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.mobile-control-btn.empty:active {
    transform: none;
}

/* Responsive superhero game */
@media (max-width: 768px) {
    #superhero-game-area {
        height: 250px;
    }
    
    .superhero-player {
        width: 28px;
        height: 28px;
    }
    
    .superhero-player::before {
        font-size: 14px;
    }
    
    .power-up,
    .obstacle {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
    }
    
    .mobile-controls {
        display: grid;
    }
    
    .game-instructions p {
        font-size: 1rem;
    }
    
    .game-stats {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .stat {
        font-size: 0.9rem;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    #superhero-game-area {
        height: 200px;
    }
    
    .superhero-player {
        width: 24px;
        height: 24px;
    }
    
    .superhero-player::before {
        font-size: 12px;
    }
    
    .power-up,
    .obstacle {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }
    
    .mobile-control-btn {
        padding: 15px;
        font-size: 1.2rem;
    }
}

/* Diary Section Styles */
.diary-section {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.diary-entry-form {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.diary-question {
    margin-bottom: 20px;
}

.diary-question label {
    display: block;
    font-weight: bold;
    color: #0078d7;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.diary-question input,
.diary-question select,
.diary-question textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Comic Neue', cursive;
    font-size: 1rem;
}

.diary-question input:focus,
.diary-question select:focus,
.diary-question textarea:focus {
    outline: none;
    border-color: #0078d7;
    box-shadow: 0 0 5px rgba(0, 120, 215, 0.3);
}

.pain-scale-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pain-scale-container input[type="range"] {
    flex: 1;
}

.pain-scale-container span {
    font-weight: bold;
    color: #0078d7;
    min-width: 30px;
}

.pain-faces {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #666;
}

.diary-actions {
    text-align: center;
    margin-top: 20px;
}

.diary-save-btn {
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
    padding: 15px 30px;
    font-size: 1.2rem;
}

.diary-note {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.diary-entries-section {
    margin-top: 30px;
}

#diary-entries-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.diary-entry {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #0078d7;
}

.diary-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.diary-entry-date {
    font-weight: bold;
    color: #0078d7;
}

.diary-entry-mood {
    font-size: 1.5rem;
}

.diary-entry-content p {
    margin: 5px 0;
    font-size: 1rem;
}

.diary-entry-content strong {
    color: #6b5b95;
}
