@import "tailwindcss";

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* ========== CSS CUSTOM PROPERTIES (Dark Mode Support) ========== */
:root {
    /* Light Mode Colors */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f9fafb;
    --color-bg-tertiary: #f3f4f6;
    --color-text-primary: #1f2937;
    --color-text-secondary: #6b7280;
    --color-border: #e5e7eb;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --color-bg-primary: #1f2937;
    --color-bg-secondary: #111827;
    --color-bg-tertiary: #374151;
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-border: #4b5563;
    --color-accent: #3b82f6;
    --color-accent-hover: #60a5fa;
}

/* ========== BASE STYLES ========== */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========== TYPOGRAPHY ========== */
.prose h1, .prose h2, .prose h3 {
    color: var(--color-text-primary);
    font-weight: 700;
}

.prose a {
    color: var(--color-accent);
    text-decoration: none;
}

.prose a:hover {
    text-decoration: underline;
}

/* ========== COMPONENTS ========== */

/* Details/Summary styling */
details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* Skeleton Screen Loader */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-tertiary) 25%,
        var(--color-border) 50%,
        var(--color-bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

/* Form Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Smooth Transitions for Theme Toggle */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Disable transitions on page load to prevent flash */
.preload * {
    transition: none !important;
}
