/* css/style.css */

/* Additional custom styles beyond Tailwind */

/* ============================================
   INPUT FIELDS
   ============================================ */

.input-field.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.input-field:focus {
    outline: none;
}

/* Number input styling */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Focus ring color customization */
.input-field:focus,
select:focus {
    ring-color: #6366f1;
}

/* Disabled input and select styling */
input:disabled,
select:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #e5e7eb;
}

/* ============================================
   GENDER BUTTONS
   ============================================ */

/* Gender button active states */
.gender-btn.active-male {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.gender-btn.active-female {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: white;
    border-color: #db2777;
    box-shadow: 0 10px 25px -5px rgba(236, 72, 153, 0.4);
}

/* ============================================
   METRIC BUTTONS
   ============================================ */

.metric-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.metric-btn:not(.active):hover {
    background-color: #e5e7eb !important;
    transform: translateY(-1px);
}

/* Metric button active state - must override everything */
.metric-btn.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
    border: 2px solid #f59e0b !important;
    cursor: default !important;
    transition: none !important;
}

.metric-btn.active:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

/* ============================================
   CALCULATE BUTTON & PROGRESS INDICATOR
   ============================================ */

/* Button calculating state */
#btn-calculate.calculating {
    cursor: wait;
    opacity: 0.9;
}

#btn-calculate.calculating:hover {
    transform: none;
}

/* Disable button state */
#btn-calculate:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Smooth transition for button text */
.btn-text {
    transition: opacity 0.2s ease;
}

/* Progress dots container */
.btn-progress {
    pointer-events: none;
}

/* Progress dots animation */
.progress-dots {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.progress-dots span {
    width: 0.375rem;
    height: 0.375rem;
    background-color: white;
    border-radius: 9999px;
    animation: bounce-dots 1s infinite;
}

.progress-dots span:nth-child(1) {
    animation-delay: 0s;
}

.progress-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.progress-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bounce-dots {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    40% {
        transform: translateY(-8px);
        opacity: 0.7;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Smooth transitions for field visibility */
.measurement-field {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Results fade in */
#results-container.show {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for gender buttons */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   RESULT CARDS
   ============================================ */

/* Hover effects for result cards */
.bg-white.transform:hover {
    transform: scale(1.05) translateY(-2px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 640px) {
    .grid.md\:grid-cols-2 {
        gap: 1rem;
    }
    
    /* Adjust progress dots size on mobile */
    .progress-dots span {
        width: 0.3rem;
        height: 0.3rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    body {
        background: white;
    }
    
    .bg-gradient-to-r,
    .bg-gradient-to-br {
        background: white !important;
    }
    
    button {
        display: none;
    }
    
    #results-container {
        display: block !important;
    }
    
    header,
    footer,
    .educational-content {
        page-break-inside: avoid;
    }
    
    /* Hide progress indicator when printing */
    .btn-progress {
        display: none !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible for keyboard navigation */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: #818cf8;
    color: white;
}

::-moz-selection {
    background-color: #818cf8;
    color: white;
}