/* Mental Care Coach - Responsive Styles */

/* Mobile First Approach */
@media (max-width: 640px) {
    /* Header adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Navigation improvements */
    .hidden.md\\:flex {
        display: none;
    }

    /* Card stacking on mobile */
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 1rem;
    }

    .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    /* Form adjustments */
    .max-w-2xl, .max-w-4xl {
        max-width: 100%;
    }

    /* Chart container on mobile */
    #moodChart {
        height: 300px !important;
    }

    /* Mood slider improvements */
    .mood-slider {
        height: 10px;
    }

    .mood-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    .mood-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    /* Emotion tags wrapping */
    #emotion-tags {
        gap: 0.5rem;
    }

    #emotion-tags label span {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }

    /* Goals section */
    .grid.grid-cols-1.md\\:grid-cols-2.gap-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 1rem;
    }

    /* Text size adjustments */
    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.875rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Button improvements */
    button[type="submit"] {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    /* Notification positioning */
    .fixed.top-4.right-4 {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        right: 1rem;
    }
}

/* Tablet styles */
@media (min-width: 641px) and (max-width: 1024px) {
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #moodChart {
        height: 350px !important;
    }
}

/* Desktop enhancements */
@media (min-width: 1025px) {
    /* Hover effects for better UX */
    .bg-white.rounded-lg.shadow-md {
        transition: all 0.3s ease;
    }

    .bg-white.rounded-lg.shadow-md:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

    /* Enhanced chart size */
    #moodChart {
        height: 400px !important;
    }

    /* Better spacing for large screens */
    .container.mx-auto {
        max-width: 1200px;
    }
}

/* Dark mode support preparation */
@media (prefers-color-scheme: dark) {
    /* This can be expanded in the future for dark mode */
    .bg-gray-50 {
        background-color: #1f2937;
    }
}

/* Print styles */
@media print {
    .custom-gradient,
    button,
    #mobile-menu {
        display: none !important;
    }

    .bg-white {
        background: white !important;
    }

    .text-gray-800 {
        color: black !important;
    }

    #moodChart {
        height: 300px !important;
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-blue-500 {
        background-color: #000080 !important;
    }

    .text-blue-600 {
        color: #000080 !important;
    }

    .border-gray-300 {
        border-color: #000000 !important;
    }
}

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

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Smooth transitions for section switching */
section {
    transition: opacity 0.3s ease-in-out;
}

section.hidden {
    opacity: 0;
    pointer-events: none;
}

section:not(.hidden) {
    opacity: 1;
}

/* Enhanced form styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Error states */
.form-input.error {
    border-color: #EF4444;
}

.error-message {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success states */
.form-input.success {
    border-color: #10B981;
}

.success-message {
    color: #10B981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Animation for stats cards */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: countUp 0.6s ease-out;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #374151;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

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

/* Mobile navigation improvements */
@media (max-width: 768px) {
    .mobile-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-nav.open {
        left: 0;
    }

    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-nav-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Enhanced button styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Custom input styles for better UX */
input[type="range"].mood-slider {
    background: linear-gradient(to right, #ef4444 0%, #fbbf24 25%, #84cc16 50%, #22c55e 75%, #10b981 100%);
}

/* Mood color indicators */
.mood-1 { color: #dc2626; }
.mood-2 { color: #ea580c; }
.mood-3 { color: #d97706; }
.mood-4 { color: #ca8a04; }
.mood-5 { color: #eab308; }
.mood-6 { color: #84cc16; }
.mood-7 { color: #65a30d; }
.mood-8 { color: #22c55e; }
.mood-9 { color: #16a34a; }
.mood-10 { color: #15803d; }