/**
 * TalkEase Custom Styles
 * Custom CSS to complement Tailwind CSS
 */

:root {
    --teal: #0EA5E9;
    --coral: #EF4444;
    --lavender: #A78BFA;
    --mint: #6EE7B7;
    --gray: #64748B;
    --golden: #F59E0B;
    --dark-gray: #475569;
    --light-bg: #F8FAFC;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--teal);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--coral);
}

/* Focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    border-color: var(--teal) !important;
}

/* Enhanced card shadows for better visibility */
.bg-white {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Better text contrast */
.text-gray-600,
.text-gray-700 {
    color: var(--dark-gray) !important;
}

/* Enhanced button visibility */
button[style*="background-color: var(--teal)"] {
    background-color: var(--teal) !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
}

button[style*="background-color: var(--teal)"]:hover {
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

/* Button hover effects */
button:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Chat message animations */
.chat-message {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Skeleton loading */
.skeleton-card, .skeleton-chart, .skeleton-list, .skeleton-default {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Button loading state */
.button-loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.spinner-inline {
    display: inline-block;
    vertical-align: middle;
}

/* Smooth transitions */
* {
    transition-property: color, background-color, border-color, opacity, transform;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

/* Quick reply buttons */
.quick-reply-btn {
    transition: all 0.2s ease;
}

.quick-reply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.quick-reply-btn:active {
    transform: translateY(0);
}

/* Password toggle button */
#togglePassword, #toggleConfirmPassword {
    transition: all 0.2s ease;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

#togglePassword:hover, #toggleConfirmPassword:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

#togglePassword:active, #toggleConfirmPassword:active {
    transform: scale(0.95);
}

/* Password input with toggle */
.relative input[type="password"],
.relative input[type="text"] {
    padding-right: 3rem !important;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--lavender);
    border-top: 3px solid var(--teal);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mood button hover */
.mood-btn:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    background: white;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid var(--teal);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f2937;
}

.toast-message {
    font-size: 14px;
    color: #6b7280;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #374151;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-spinner-large {
    border: 4px solid var(--lavender);
    border-top: 4px solid var(--teal);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.button-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--lavender);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

/* Form validation styles */
.form-field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-field-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.success-message {
    color: #10b981;
    font-size: 14px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Password strength indicator */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.password-strength-weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-strong {
    width: 100%;
    background: #10b981;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--teal);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

/* Enhanced UI Improvements */
body {
    color: #1e293b;
    font-weight: 400;
}

/* Better section backgrounds */
section {
    position: relative;
}

section.bg-white {
    background-color: #ffffff !important;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

/* Better card visibility */
.bg-white.rounded-lg {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0;
}

/* Improved text readability */
h1, h2, h3, h4, h5, h6 {
    color: #0f172a;
    font-weight: 700;
}

/* Better input fields */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    background-color: #ffffff;
    border: 2px solid #cbd5e1;
    color: #1e293b;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    background-color: #ffffff;
    border-color: var(--teal);
}

/* Enhanced navigation */
nav.bg-white {
    background-color: #ffffff !important;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Better button contrast */
button[style*="background-color: var(--coral)"] {
    background-color: var(--coral) !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Improved statistics cards */
.text-4xl {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Better mood buttons when selected */
.mood-btn[style*="background-color: var(--teal)"] {
    background-color: var(--teal) !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

.mood-btn[style*="background-color: var(--teal)"] .text-sm {
    color: white !important;
    font-weight: 600;
}

/* Chart period buttons */
.chart-period-btn {
    font-weight: 600;
    border: 2px solid transparent;
}

.chart-period-btn[style*="background-color: var(--teal)"] {
    background-color: var(--teal) !important;
    color: white !important;
    border-color: var(--teal) !important;
}

/* Print styles */
@media print {
    nav, footer, .no-print {
        display: none;
    }
}

