/* Tailwind CSS Fixes and Custom Styles */

/* Fix for disabled buttons */
.follow-taxonomy-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Custom offcanvas animations */
.offcanvas {
    transition: transform 0.3s ease-in-out;
}

.offcanvas.translate-y-full {
    transform: translateY(100%);
}

.offcanvas.translate-x-full {
    transform: translateX(100%);
}

/* Custom modal animations */
.modal {
    transition: opacity 0.3s ease-in-out;
}

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

/* Toast animations */
.toast {
    transition: all 0.3s ease-in-out;
}

.toast.hidden {
    opacity: 0;
    transform: translateY(20px);
}

/* Custom tooltip styles */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
}

/* Night mode fixes */
.Nightmode .contentcard {
    background: #1f2937 !important;
    color: #f9fafb;
}

.Nightmode .contentcard h5 {
    color: #f9fafb !important;
}

.Nightmode .contentcard p {
    color: #d1d5db !important;
}

/* Swiper custom styles */
.swiper-slide {
    height: auto;
}

/* Custom button styles for better UX */
.btn-read:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-share:hover,
.btn-like:hover {
    transform: scale(1.05);
}

/* Loading animation for buttons */
.loadbtn {
    position: relative;
    pointer-events: none;
}

.loadbtn .btn-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive fixes */
@media (max-width: 640px) {
    .modal {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .offcanvas {
        height: 80vh;
    }
}

/* Custom scrollbar */
.offcanvas-body::-webkit-scrollbar {
    width: 4px;
}

.offcanvas-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.offcanvas-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.offcanvas-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Line clamp utilities for Tailwind */
.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;
}

/* News card fixes */
.contentcard {
    max-height: 100vh;
    overflow: hidden;
}

.contentcard .p-4 {
    padding: 0.75rem;
}

.contentcard .article-btns {
    margin-top: auto;
    padding-top: 0.5rem;
}

/* Ensure buttons stay visible */
.contentcard .flex.gap-1 {
    flex-wrap: nowrap;
}

.contentcard .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .contentcard .p-4 {
        padding: 0.5rem;
    }
    
    .contentcard .text-sm {
        font-size: 0.875rem;
    }
    
    .contentcard .text-xs {
        font-size: 0.625rem;
    }
}
