/* Header Improvements */
.navbar-brand:hover {
    text-decoration: none;
    color: var(--bs-primary) !important;
}

.nav-link:hover {
    color: var(--bs-primary) !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Personalized Guidance Styling */
.breathing-instructions {
    background-color: var(--bs-dark) !important;
    border: 1px solid var(--bs-primary) !important;
}

.breathing-instructions .card-body {
    background-color: transparent;
}

.breathing-instructions .alert-primary {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    border-color: var(--bs-primary) !important;
    color: var(--bs-light) !important;
}

/* Breathing Circle Animations */
.breathing-circle {
    transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
    position: relative;
    overflow: hidden;
}

.breathing-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 1s ease-in-out;
}

.breathing-circle.inhale {
    transform: scale(1.2);
    box-shadow: 0 0 50px rgba(var(--bs-primary-rgb), 0.6);
}

.breathing-circle.inhale::before {
    transform: translate(-50%, -50%) scale(1);
}

.breathing-circle.hold {
    transform: scale(1.2);
    box-shadow: 0 0 50px rgba(var(--bs-primary-rgb), 0.6);
}

.breathing-circle.exhale {
    transform: scale(0.8);
    box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.3);
}

.breathing-circle.exhale::before {
    transform: translate(-50%, -50%) scale(0);
}

/* Pulsing animation for active state */
@keyframes pulse {
    0% {
        box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(var(--bs-primary-rgb), 0.6);
    }
    100% {
        box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.3);
    }
}

.breathing-circle.active {
    animation: pulse 2s infinite;
}

/* Smooth text transitions */
.breathing-text, .breathing-count {
    transition: opacity 0.3s ease-in-out;
}

/* Progress animations */
.progress-bar {
    transition: width 0.3s ease-in-out;
}

/* Button hover effects */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* Fade in animation for page content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeIn 0.5s ease-in-out;
}

/* Intensity rating buttons */
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-success {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(var(--bs-primary-rgb), 0.5);
}

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

.spinner {
    border: 2px solid rgba(var(--bs-primary-rgb), 0.1);
    border-left: 2px solid var(--bs-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Mobile-specific animations */
@media (max-width: 768px) {
    .breathing-circle {
        width: 150px;
        height: 150px;
    }
    
    .breathing-circle.inhale,
    .breathing-circle.hold {
        transform: scale(1.1);
    }
    
    .breathing-circle.exhale {
        transform: scale(0.9);
    }
}

/* Interactive Breathing Visualization */
.interactive-breathing-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

#breathingCanvas {
    border-radius: 50%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

#breathingCanvas:hover {
    transform: scale(1.02);
}

.breathing-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

.breathing-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-light);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.breathing-count {
    font-size: 1rem;
    color: var(--bs-light);
    opacity: 0.8;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
}

.phase-indicator {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    animation: phaseGlow 2s ease-in-out infinite alternate;
}

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

/* Breathing phase colors */
.breathing-container.inhale .breathing-text {
    color: #2ecc71;
}

.breathing-container.hold .breathing-text {
    color: #3498db;
}

.breathing-container.exhale .breathing-text {
    color: #9b59b6;
}

/* Interactive visualization enhancements */
.session-container {
    min-height: 100vh;
    background: linear-gradient(135deg, 
        rgba(52, 152, 219, 0.1) 0%, 
        rgba(155, 89, 182, 0.1) 100%);
}

.breathing-instructions {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive design for interactive breathing */
@media (max-width: 768px) {
    .interactive-breathing-container {
        width: 250px;
        height: 250px;
    }
    
    #breathingCanvas {
        width: 250px !important;
        height: 250px !important;
    }
    
    .breathing-text {
        font-size: 1.2rem;
    }
    
    .phase-indicator {
        font-size: 1.2rem;
    }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .breathing-circle,
    .breathing-circle::before,
    .card,
    .btn,
    .progress-bar {
        transition: none;
        animation: none;
    }
    
    .breathing-circle.active {
        animation: none;
        box-shadow: 0 0 30px rgba(var(--bs-primary-rgb), 0.4);
    }
    
    .phase-indicator {
        animation: none;
    }
    
    #breathingCanvas:hover {
        transform: none;
    }
    
    @keyframes phaseGlow {
        0%, 100% { opacity: 0.8; transform: none; }
    }
}

/* Body scan visualization styles */
.body-scan-wrapper {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(25, 135, 84, 0.05) 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.body-diagram {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 1rem;
    padding: 1rem;
}

.body-part {
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.body-part:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

#scanLine {
    transition: all 0.5s ease-in-out;
    filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.8));
}

.body-part-card {
    transition: all 0.3s ease-in-out;
    border: 2px solid transparent;
}

.body-part-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.body-part-card.border-primary {
    animation: pulse-border 2s infinite;
}

.body-part-card.border-success {
    animation: success-glow 0.5s ease-in-out;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }
    50% {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 8px rgba(13, 110, 253, 0);
    }
}

@keyframes success-glow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

.scan-progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

/* Body scan responsive design */
@media (max-width: 768px) {
    .body-scan-wrapper {
        padding: 1rem;
    }
    
    .body-diagram {
        padding: 0.5rem;
    }
    
    .body-part-card .card-body {
        padding: 0.5rem;
    }
    
    .body-part-card h6 {
        font-size: 0.8rem;
    }
}

/* Wave Surfing Animations */
.wave-canvas-container {
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.wave-canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

/* Animated wave effects */
@keyframes waveFlow {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

.wave-canvas-container svg path {
    animation: waveFlow 8s ease-in-out infinite;
}

.wave-canvas-container svg path:nth-child(2) {
    animation-delay: -2s;
}

.wave-canvas-container svg path:nth-child(3) {
    animation-delay: -4s;
}

/* Surfer bobbing animation */
@keyframes surferBob {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

#surfer {
    animation: surferBob 3s ease-in-out infinite;
    transform-origin: 50% 90%;
}

/* Wave intensity pulse */
@keyframes wavePulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

#urgeWave {
    animation: wavePulse 2s ease-in-out infinite;
}

/* Wave phase markers */
.wave-marker {
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.wave-marker:hover {
    background: rgba(108, 117, 125, 0.1);
    transform: scale(1.05);
}

.wave-marker i {
    transition: color 0.3s ease;
    width: 16px;
    height: 16px;
}

/* Progress animations */
#waveProgressBar {
    transition: width 1s ease-out;
}

#urgeIntensityBar {
    transition: width 0.5s ease-out, background-color 0.3s ease;
}

/* Phase badge animations */
#wavePhase {
    transition: all 0.3s ease;
    animation: wavePhaseGlow 2s ease-in-out infinite;
}

@keyframes wavePhaseGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(52, 152, 219, 0.3); }
    50% { box-shadow: 0 0 15px rgba(52, 152, 219, 0.6); }
}

/* Wave surfing responsive design */
@media (max-width: 768px) {
    .wave-surf-wrapper {
        max-width: 320px;
    }
    
    .wave-canvas-container {
        height: 250px;
    }
    
    .wave-intensity-meter {
        font-size: 0.8rem;
    }
    
    .wave-progress {
        font-size: 0.8rem;
    }
    
    .wave-marker small {
        font-size: 0.7rem;
    }
}
