/* TripRate – Custom CSS (supplements Tailwind CDN) */

/* =============================================
   BASE & UTILITIES
   ============================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* =============================================
   STAR RATING DISPLAY
   ============================================= */

.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
    user-select: none;
}

.star-rating span {
    display: inline-block;
    line-height: 1;
}

/* Interactive stars (rating form widget) */
.interactive-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.interactive-stars .star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 1.5rem;
    transition: transform 0.1s ease, color 0.1s ease;
    color: #d1d5db;
}

.interactive-stars .star-btn:hover,
.interactive-stars .star-btn.active,
.interactive-stars .star-btn.hovered {
    color: #facc15;
    transform: scale(1.15);
}

.interactive-stars .star-btn.selected {
    color: #f59e0b;
}

/* =============================================
   TRIP CARD
   ============================================= */

.trip-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.trip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.trip-card .card-body {
    flex: 1;
}

/* =============================================
   PHOTO GALLERY GRID
   ============================================= */

.photo-gallery {
    display: grid;
    gap: 0.5rem;
}

.photo-gallery.grid-cols-2 .photo-thumb:first-child {
    grid-column: span 2;
    aspect-ratio: 16/9;
}

.photo-thumb {
    display: block;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: #f3f4f6;
    aspect-ratio: 1;
    position: relative;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-thumb:hover img {
    transform: scale(1.04);
}

/* =============================================
   TAG CLOUD
   ============================================= */

.tag-cloud {
    line-height: 2;
}

.tag-cloud-item {
    display: inline-block;
    transition: transform 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
}

.tag-cloud-item:hover {
    transform: scale(1.12);
    opacity: 1 !important;
    text-decoration: underline;
}

/* =============================================
   COMMENT THREAD INDENTATION
   ============================================= */

.comment-item {
    position: relative;
}

.comment-item .comment-item {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
    border-left: 2px solid #e5e7eb;
}

.comment-item .comment-item .comment-item {
    border-left-color: #d1d5db;
}

/* =============================================
   PAGINATION
   ============================================= */

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
}

.pagination-btn:hover:not(.pagination-btn-active):not([class*="opacity-40"]) {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.pagination-btn-active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #fff;
    pointer-events: none;
}

/* =============================================
   FLASH MESSAGES
   ============================================= */

.flash-message {
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   TAG CHIP INPUT
   ============================================= */

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #eff6ff;
    color: #1d4ed8;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid #bfdbfe;
    cursor: default;
    white-space: nowrap;
}

.tag-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #3b82f6;
    font-size: 0.875rem;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
    transition: color 0.1s;
}

.tag-chip-remove:hover {
    color: #dc2626;
}

/* =============================================
   PHOTO PREVIEW (upload)
   ============================================= */

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f3f4f6;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.1s;
}

.photo-preview-item .remove-btn:hover {
    background: #dc2626;
}

/* =============================================
   PROSE STYLES (trip report body)
   ============================================= */

.prose {
    color: #374151;
    max-width: none;
    font-size: 0.9375rem;
    line-height: 1.75;
}

.prose h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.prose h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
}

.prose p {
    margin-top: 0;
    margin-bottom: 1em;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.prose li {
    margin-bottom: 0.25em;
}

.prose strong {
    font-weight: 700;
    color: #111827;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose blockquote {
    border-left: 4px solid #dbeafe;
    padding-left: 1rem;
    color: #6b7280;
    font-style: italic;
    margin: 1em 0;
}

/* =============================================
   RESPONSIVE TABLE HELPERS
   ============================================= */

@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

/* =============================================
   DROPDOWN ANIMATION
   ============================================= */

[id$="-dropdown"]:not(.hidden) {
    animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   FORM FOCUS RING FIX (Tailwind v3 CDN compat)
   ============================================= */

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}
