/* Custom Design Tokens & Overrides */

:root {
    --emerald-primary: #10b981;
    --emerald-dark: #064e3b;
    --emerald-glow: rgba(16, 185, 129, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #022c22;
}

::-webkit-scrollbar-thumb {
    background: #065f46;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #10b981;
}

/* Custom Selection */
::selection {
    background: rgba(16, 185, 129, 0.3);
    color: #fff;
}

/* Smooth Transitions */
.transition-slow {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism Enhancements */
.glass-effect:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Typography Enhancements */
.font-display {
    font-family: 'Outfit', sans-serif;
}

/* Utilities */
.text-balance {
    text-wrap: balance;
}

/* Animation Overrides */
@keyframes pulse-emerald {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-subtle {
    animation: pulse-emerald 3s ease-in-out infinite;
}

/* ===== Professional Card Styles ===== */
.card-professional {
    background: #ffffff;
    border: 1px solid rgba(2, 44, 34, 0.08);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-professional:hover {
    border-color: rgba(2, 44, 34, 0.15);
    box-shadow: 0 25px 50px -12px rgba(2, 44, 34, 0.08);
    transform: translateY(-4px);
}

.card-professional img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-professional:hover img {
    transform: scale(1.05);
}

/* ===== Hero Carousel ===== */
@keyframes carousel-fade-in {
    from { opacity: 0; transform: scale(1.05); }
    to { opacity: 1; transform: scale(1); }
}

.carousel-slide {
    animation: carousel-fade-in 1s ease-out;
}

.carousel-slide-active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide-hidden {
    opacity: 0;
    z-index: 0;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot-active {
    background: #ffffff;
    width: 24px;
    border-radius: 4px;
}

.carousel-dot-v {
    width: 4px;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-dot-v-active {
    background: #88c9a1;
    height: 32px;
    box-shadow: 0 0 15px rgba(136, 201, 161, 0.5);
}

/* ===== Image Overlay Gradient ===== */
.img-overlay-dark {
    background: linear-gradient(
        to bottom,
        rgba(2, 44, 34, 0.3) 0%,
        rgba(2, 44, 34, 0.5) 40%,
        rgba(2, 44, 34, 0.85) 100%
    );
}

.img-overlay-dark-top {
    background: linear-gradient(
        to top,
        transparent 0%,
        rgba(2, 44, 34, 0.6) 100%
    );
}

/* ===== Article Card Styles ===== */
.article-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover {
    transform: translateY(-2px);
}

.article-card .article-image {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover .article-image {
    transform: scale(1.03);
}

/* ===== Event Detail Hero ===== */
.event-hero {
    min-height: 50vh;
    position: relative;
}

.event-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(2, 44, 34, 0.2) 0%,
        rgba(2, 44, 34, 0.7) 70%,
        rgba(2, 44, 34, 0.95) 100%
    );
}

/* ===== Icon Picker ===== */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}

.icon-picker-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    color: #374151;
    background: white;
}

.icon-picker-item:hover {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.icon-picker-item.selected {
    border-color: #065f46;
    background: #065f46;
    color: white;
}

/* ===== Responsive Image Grid ===== */
.masonry-grid {
    columns: 2;
    column-gap: 1rem;
}

.masonry-grid > * {
    break-inside: avoid;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .masonry-grid {
        columns: 3;
    }
}

/* ===== Zoom In Animation ===== */
@keyframes zoom-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-zoom-in {
    animation: zoom-in 0.3s ease-out;
}

/* ===== Line Clamp Utilities ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== No Scrollbar ===== */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ===== Event Card Transition ===== */
.event-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Fade In Animation ===== */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== Reading Progress Bar ===== */
#reading-progress-bar {
    transform-origin: left;
    transition: width 0.1s linear, background-color 0.5s ease;
}

/* ===== Back to Top Button ===== */
#back-to-top {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(2, 44, 34, 0.3);
}

/* ===== Toast Notification ===== */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.toast {
    background: #022c22;
    color: white;
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes toast-in {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast-out {
    animation: toast-out 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-out {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100px); opacity: 0; }
}

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* HTMX Transition Classes */
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.htmx-settling {
    opacity: 0;
}

@keyframes fade-in-page {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-page {
    animation: fade-in-page 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.htmx-request {
    cursor: wait;
}

/* Dynamic Padding Managed by JS */
body {
    transition: padding-top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
