/**
 * Main Stylesheet for Karpathos Island Catalog
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --white-color: #ffffff;
    --black-color: #000000;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    background-color: #f5f5f5;
    line-height: 1.6;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    opacity: 0.8;
}

/* Header Styles */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Category Cards */
.category-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.category-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;
}

/* Listing Cards */
.listing-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.listing-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.featured-listing {
    border: 2px solid var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    z-index: 1;
}

/* Image Gallery */
.gallery-thumbnail {
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
    transition: opacity 0.3s ease;
}

.gallery-thumbnail:hover {
    opacity: 0.8;
}

.gallery-main-image {
    max-height: 500px;
    width: 100%;
    object-fit: contain;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-main-image:hover {
    transform: scale(1.02);
}

/* Lightbox Styles */
.lightbox-img {
    max-height: 100vh;
    border-radius: 5px;
    object-fit: contain;
}

.lightbox-controls {
    display: flex;
    align-items: center;
    justify-content: center;
}

#imageLightbox .modal-content {
    background-color: rgba(33, 37, 41, 0.95);
}

#imageLightbox .modal-dialog {
    max-width: 95%;
    margin: 0.5rem auto;
}

#imageLightbox .modal-header,
#imageLightbox .modal-footer {
    padding: 0.5rem 1rem;
}

#imageLightbox .btn-close-white {
    color: #fff;
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Drop Zone */
.drop-zone {
    width: 100%;
    height: 200px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    color: #777;
    border: 2px dashed #ccc;
    border-radius: 10px;
    background-color: #f8f9fa;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.drop-zone-active {
    border-color: var(--primary-color);
    background-color: #e8f4fe;
}

.drop-zone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.drop-zone-prompt i {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.drop-zone-input {
    display: none;
}

/* Map Containers */
.map-container {
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.small-map {
    height: 250px;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.required-field::after {
    content: " *";
    color: var(--danger-color);
}

/* Location Autocomplete */
#location-suggestions {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    z-index: 1000;
}

#location-suggestions .dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#location-suggestions .dropdown-item:hover,
#location-suggestions .dropdown-item.active {
    background-color: #e9ecef;
    color: var(--dark-color);
}

#location-error {
    display: none;
    margin-top: 0.25rem;
    color: var(--danger-color);
}

/* Admin Panel */
.admin-sidebar {
    background-color: var(--dark-color);
    color: var(--white-color);
    min-height: calc(100vh - 56px);
    padding-top: 20px;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    margin-bottom: 5px;
    border-radius: 5px;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white-color);
}

.admin-sidebar .nav-link i {
    margin-right: 10px;
}

/* User Profile */
.avatar-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}

.avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.avatar-upload:hover {
    background-color: #0b5ed7;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    font-size: 1.5rem;
    color: #ffc107;
}

/* For review form - use a different direction for interactive stars */
form .star-rating {
    flex-direction: row-reverse; /* Reverse the order for better UX */
    justify-content: flex-end;
}

.rating-input {
    display: none;
}

.rating-label {
    cursor: pointer;
    padding: 0;
    margin: 0 2px;
    line-height: 1;
}

/* For display-only star ratings (not in forms), use smaller size */
.star-rating.small {
    font-size: 1rem;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(13, 110, 253, 0.2);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-message {
    font-size: 1.2rem;
    color: var(--dark-color);
    font-weight: 500;
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer a {
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .map-container {
        height: 300px;
    }
    
    .gallery-main-image {
        max-height: 350px;
    }
    
    .gallery-thumbnail {
        height: 80px;
    }
}

@media (max-width: 575.98px) {
    .category-card, .listing-card {
        margin-bottom: 20px;
    }
    
    .admin-sidebar {
        min-height: auto;
    }
}
