/* ParkinPal Custom Styles */

/* Base Styles */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    scroll-behavior: smooth;
}

body {
    overscroll-behavior: none;
}

/* Headings use Montserrat Alternates */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat Alternates', sans-serif;
}

/* Prevent text selection on interactive elements */
button {
    user-select: none;
    -webkit-user-select: none;
}

/* Spinner Animation */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E5E7EB;
    border-top-color: #6CBEED;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Styles */
.toast {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    max-width: 90vw;
}

.toast-success {
    background-color: #10B981;
    color: white;
}

.toast-error {
    background-color: #EF4444;
    color: white;
}

.toast-info {
    background-color: #6CBEED;
    color: white;
}

.toast-warning {
    background-color: #F59E0B;
    color: white;
}

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

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

/* Section Transitions */
.section {
    transition: opacity 0.2s ease;
}

.section.hidden {
    display: none;
}

/* Test Buttons - White with shadow and press animation */
.test-btn {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.test-btn:active {
    transform: scale(0.97);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Chart Container */
#tremor-chart-container,
#voice-waveform-container {
    min-height: 200px;
}

/* History Item */
.history-item {
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.history-item:hover {
    background-color: #F9FAFB;
}

.history-item:active {
    background-color: #F3F4F6;
}

/* Severity Badge */
.severity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.severity-low {
    background-color: #D1FAE5;
    color: #065F46;
}

.severity-medium {
    background-color: #FEF3C7;
    color: #92400E;
}

.severity-high {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* Pulse Animation for Recording */
.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Waveform Canvas */
#voice-waveform {
    width: 100%;
    background: linear-gradient(to bottom, #E8F1F5, #ADBABD);
    border-radius: 8px;
}

/* Report Content Styling */
#report-content {
    line-height: 1.7;
}

#report-content p {
    margin-bottom: 12px;
}

#report-content p.report-p {
    margin-bottom: 14px;
}

#report-content strong {
    font-weight: 600;
    color: #374151;
}

#report-content em {
    font-style: italic;
    color: #4B5563;
}

#report-content ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

#report-content li {
    margin-bottom: 6px;
}

/* Responsive Adjustments */
@media (min-width: 428px) {
    .max-w-md {
        max-width: 428px;
    }
}

/* Focus States for Accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #6EB4D1;
    outline-offset: 2px;
}

/* Chart.js Responsive */
canvas {
    max-width: 100%;
}

/* Loading State Button */
button:disabled {
    cursor: not-allowed;
}

/* Smiley Face Floating Animation */
.smiley-face {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Countdown Animation */
#tremor-countdown,
#voice-countdown {
    transition: transform 0.1s ease;
}

#tremor-countdown.tick,
#voice-countdown.tick {
    transform: scale(1.1);
}

/* Typewriter Effect */
.typewriter-container {
    overflow: hidden;
    white-space: nowrap;
}

.typewriter-text {
    display: inline-block;
    border-right: 3px solid #6CBEED;
    padding-right: 5px;
    animation: typewriter 2s steps(20) 0.5s forwards, blink 0.75s step-end infinite;
    width: 0;
    overflow: hidden;
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typewriter-text.complete {
    border-right: none;
    animation: none;
    width: auto;
}

/* Smiley Face Container */
.smiley-container {
    position: relative;
}

/* Back Button Styles */
#tremor-back,
#voice-back,
#trends-back,
#report-back {
    transition: all 0.2s ease;
}

#tremor-back:hover,
#voice-back:hover,
#trends-back:hover,
#report-back:hover {
    transform: translateX(-3px);
}

/* Input Styles */
input[type="text"] {
    transition: all 0.2s ease;
}

input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

/* Card Shadow Animation */
.bg-white.rounded-xl {
    transition: box-shadow 0.3s ease;
}

/* Subtle button press for all buttons */
button {
    transition: all 0.15s ease;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Name submit button specific */
#name-submit {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#name-submit:active {
    transform: scale(0.97);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
