/* Custom styles for the Hand Tracking application - Tailwind CSS Compatible */

/* Glass effect utility classes */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Button components */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background-color: #3b82f6;
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: scale(1);
}

.btn-primary:hover {
    background-color: #2563eb;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background-color: #d946ef;
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: scale(1);
}

.btn-secondary:hover {
    background-color: #c026d3;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

/* Input field components */
.input-field {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.input-field:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: transparent;
}

/* Card components */
.card-elevated {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.card-elevated:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Gradient utilities */
.gradient-primary {
    background: linear-gradient(to right, #3b82f6, #1d4ed8);
}

.gradient-secondary {
    background: linear-gradient(to right, #d946ef, #a21caf);
}

.gradient-mesh {
    background: linear-gradient(to bottom right, #3b82f6, #d946ef, #1d4ed8);
}

.bg-gradient-primary {
    background: linear-gradient(to right, #3b82f6, #1d4ed8);
}

.bg-gradient-secondary {
    background: linear-gradient(to right, #d946ef, #a21caf);
}

/* Enhanced Video styling */
.video-container {
    position: relative;
    overflow: hidden;
}

.video-canvas {
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.video-canvas:hover {
    transform: scale(1.02);
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.35);
}

/* Enhanced 3D Canvas styling */
.three-canvas {
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.three-canvas:hover {
    transform: scale(1.02);
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.35);
}

/* Enhanced joint info panel */
.joint-info-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.joint-info-panel:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Enhanced status indicators */
.status-online {
    background-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.status-offline {
    background-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

/* Enhanced hand landmarks */
.landmark-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3b82f6;
    border: 2px solid #ffffff;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.landmark-point:hover {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.6);
}

.landmark-point.selected {
    background-color: #ef4444;
    transform: translate(-50%, -50%) scale(1.5);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6);
}

/* Enhanced loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #3b82f6;
    animation: spin 1s linear infinite;
}

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

/* Custom slider styling */
.slider-primary {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #3b82f6 0%, #60a5fa 100%);
    outline: none;
    transition: all 0.2s ease;
}

.slider-primary::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.slider-primary::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

.slider-primary::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

/* Shadow utilities */
.shadow-glow-blue {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.shadow-glow-purple {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.shadow-glass {
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* 3D View Controls styling */
.view-control-btn {
    transition: all 0.2s ease;
    transform: scale(1);
}

.view-control-btn:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.3) !important;
}

.view-control-btn:active {
    transform: scale(0.95);
}

.view-control-btn.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Auto-rotate button animation */
.auto-rotate-active {
    animation: rotate-pulse 2s ease-in-out infinite;
}

@keyframes rotate-pulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05) rotate(180deg);
        opacity: 0.8;
    }
}

/* Enhanced bounce animation for 3D indicator */
.animate-bounce-gentle {
    animation: bounce-gentle 2s ease-in-out infinite;
}

@keyframes bounce-gentle {
    0%, 100% { 
        transform: translateY(0);
        opacity: 1;
    }
    50% { 
        transform: translateY(-4px);
        opacity: 0.7;
    }
}

/* Recording-specific styles */
.btn-secondary.bg-red-600 {
    background-color: #dc2626;
}

.btn-secondary.bg-red-600:hover {
    background-color: #b91c1c;
}

/* Recording status animations */
@keyframes recording-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.recording-indicator {
    animation: recording-pulse 1s ease-in-out infinite;
}

/* Recording timer styling */
.recording-timer {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-feature-settings: "tnum";
}

/* Enhanced responsive adjustments */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .video-container,
    .three-container {
        width: 100%;
        height: 300px;
    }
    
    .glass-card {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .card-elevated {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 640px) {
    .slider-primary::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    
    .slider-primary::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-card {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid #000;
    }
    
    .status-indicator {
        border: 2px solid #000;
    }
}

/* Index finger angle display styling */
.angle-display {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transition: all 0.3s ease;
}

.angle-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.angle-value {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-feature-settings: "tnum";
}

/* Hand type indicators */
.hand-indicator-left {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #3b82f6;
}

.hand-indicator-right {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-left: 4px solid #ec4899;
}

/* Real-time update animation */
@keyframes pulse-update {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.updating {
    animation: pulse-update 0.5s ease-in-out;
}
