﻿/* Custom styles for TripJournal */
body {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.view-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Star Rating Component */
.star-rating {
    display: flex;
    gap: 4px;
    cursor: pointer;
}

    .star-rating i {
        color: #d1d5db;
        transition: color 0.2s;
    }

        .star-rating i.active {
            color: #fbbf24;
            fill: #fbbf24;
        }

/* Map Styles */
#mapContainer {
    z-index: 1;
    min-height: 400px;
}

.leaflet-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Map Modal Fixes */
#mapModal {
    z-index: 1000;
}

    #mapModal .bg-white {
        min-height: 600px;
    }

/* Ensure map tiles load */
.leaflet-tile {
    filter: none !important;
}

/* Map loading indicator */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
}

    .map-loading .spinner {
        margin-right: 8px;
    }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* Image Upload Preview */
.image-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.75rem;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

    .image-preview:hover {
        opacity: 0.9;
    }

/* Card Hover Effects */
.place-card, .trip-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

    .place-card:active, .trip-card:active {
        transform: scale(0.98);
    }

/* Form Inputs */
input, textarea, select {
    -webkit-appearance: none;
    appearance: none;
}

/* Safe area for iOS */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}



.spinner-large {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loader overlay transition */
#loader {
    transition: opacity 0.2s ease-in-out;
}

#loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Rating Sliders */
.rating-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}

    .rating-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #3b82f6;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

/* Additional utility classes */
.fill-current {
    fill: currentColor;
}

.fill-amber-400 {
    fill: #fbbf24;
}

/* Hide scrollbar for horizontal scroll */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* RTL/LTR Support */
[dir="rtl"] .text-right {
    text-align: right;
}

[dir="rtl"] .text-left {
    text-align: left;
}

[dir="rtl"] .mr-1 {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] .mr-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .mr-3 {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .mr-4 {
    margin-right: 0;
    margin-left: 1rem;
}

[dir="rtl"] .ml-1 {
    margin-left: 0;
    margin-right: 0.25rem;
}

[dir="rtl"] .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .ml-3 {
    margin-left: 0;
    margin-right: 0.75rem;
}

[dir="rtl"] .ml-4 {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .pl-10 {
    padding-left: 0;
    padding-right: 2.5rem;
}

[dir="rtl"] .left-3 {
    left: auto;
    right: 0.75rem;
}

[dir="rtl"] .right-1 {
    right: auto;
    left: 0.25rem;
}

[dir="rtl"] .right-2 {
    right: auto;
    left: 0.5rem;
}

[dir="rtl"] .right-3 {
    right: auto;
    left: 0.75rem;
}

[dir="rtl"] .right-4 {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .left-4 {
    left: auto;
    right: 1rem;
}

/* RTL Navigation */
[dir="rtl"] .flex-row-reverse {
    flex-direction: row-reverse;
}

/* RTL Form Elements */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
}

/* Toast Animation */
.animate-fade-in-down {
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Profile Tabs */
.profile-tab {
    animation: fadeIn 0.3s ease-in-out;
}

    .profile-tab.hidden {
        display: none;
    }
