/* Morning Devotion - Design System Styles */

/* ==================== Base ==================== */
html {
    scroll-behavior: smooth;
}

*:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==================== Typography Utilities ==================== */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Prose styling for devotional content */
.prose p {
    margin-bottom: 1rem;
}

.prose blockquote {
    border-left: 4px solid #6366f1;
    padding-left: 1rem;
    font-style: italic;
    color: #4b5563;
}

/* Bible verse highlighting */
.verse-text.highlighted {
    background-color: #fef3c7;
    border-radius: 2px;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

/* ==================== Animations ==================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 20px; height: 20px; border-width: 2px; }
.spinner-lg { width: 56px; height: 56px; border-width: 5px; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Slide animations */
.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Skeleton shimmer */
.skeleton-shimmer {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .skeleton-shimmer {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Bounce dots */
@keyframes bounceDot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.bounce-dot { animation: bounceDot 1.4s ease-in-out infinite both; }
.bounce-dot:nth-child(1) { animation-delay: -0.32s; }
.bounce-dot:nth-child(2) { animation-delay: -0.16s; }

/* ==================== Toast Notifications ==================== */
.toast {
    min-width: 280px;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease-out;
    transition: opacity 0.3s, transform 0.3s;
}

.toast-success { background: #ecfdf5; border-left: 4px solid #10b981; color: #065f46; }
.toast-error   { background: #fef2f2; border-left: 4px solid #ef4444; color: #991b1b; }
.toast-warning { background: #fffbeb; border-left: 4px solid #f59e0b; color: #92400e; }
.toast-info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }

.dark .toast-success { background: #064e3b; color: #d1fae5; }
.dark .toast-error   { background: #7f1d1d; color: #fee2e2; }
.dark .toast-warning { background: #78350f; color: #fef3c7; }
.dark .toast-info    { background: #1e3a5f; color: #dbeafe; }

.toast-dismiss {
    transition: opacity 0.3s;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 0.5rem;
    animation: toastProgress var(--toast-duration, 4s) linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ==================== Dark Mode Overrides ==================== */
.dark body {
    background-color: #111827;
    color: #e5e7eb;
}

.dark .bg-white {
    background-color: #1f2937;
}

.dark .bg-gray-50 {
    background-color: #111827;
}

.dark .bg-gray-100 {
    background-color: #1a2332;
}

.dark .text-gray-800 {
    color: #f3f4f6;
}

.dark .text-gray-700 {
    color: #d1d5db;
}

.dark .text-gray-600 {
    color: #9ca3af;
}

.dark .text-gray-500 {
    color: #6b7280;
}

.dark .border-gray-100,
.dark .border-gray-200,
.dark .border-gray-300 {
    border-color: #374151;
}

.dark .shadow-sm,
.dark .shadow {
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.3);
}

.dark .prose blockquote {
    color: #9ca3af;
}

.dark .verse-text.highlighted {
    background-color: #78350f;
}

/* ==================== Print Styles ==================== */
@media print {
    nav, footer, .no-print, button, #toast-container {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .prose {
        max-width: 100%;
    }
}

/* ==================== Responsive Utilities ==================== */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Toggle switch transition */
[type="checkbox"] + div {
    transition: background-color 0.2s ease;
}

[type="checkbox"] + div::after {
    transition: transform 0.2s ease;
}

/* Password toggle */
.password-wrapper { position: relative; }
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
}
.password-toggle:hover { color: #6b7280; }
