/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2C3E50 0%, #1A252F 100%);
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    border-radius: 0 0 15px 15px;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo {
    font-family: 'Orbitron', sans-serif;
}

.logo span {
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo span:hover {
    transform: translateY(-5px);
}

.logo .s { color: #FFD700; }
.logo .o { color: #FFA500; }
.logo .n { color: #8B4513; }
.logo .a { color: #DAA520; }
.logo .r { color: #B8860B; }

.logo h1 {
    font-size: 48px;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    color: #FFF8DC;
    margin: 5px 0 0 0;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

/* Register Button */
.register-btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    margin: 25px 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.register-btn:hover {
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #FFE44D, #FFB347);
}

.register-btn i {
    margin-right: 8px;
}

/* Search Section */
.search-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #FFD700;
    font-size: 18px;
}

#shopSearch {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border-radius: 50px;
    border: 2px solid #e0e0e0;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
}

#shopSearch:focus {
    border-color: #FFD700;
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
    background-color: white;
}

.filters {
    display: flex;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.filters select {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    background: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFD700%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 20px top 50%;
    background-size: 12px auto;
    padding-right: 40px;
}

.filters select:hover {
    border-color: #FFD700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

.filters select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

/* Shop Cards */
.shops-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.shop-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.08);
}

.shop-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
}

.shop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.shop-card:hover .shop-image {
    transform: scale(1.05);
}

.shop-info {
    padding: 20px;
}

.shop-info h3 {
    margin: 0 0 10px;
    color: #333;
    font-size: 1.2em;
}

.shop-info p {
    margin: 5px 0;
    color: #666;
}

.shop-info i {
    width: 20px;
    color: #FFD700;
    margin-right: 8px;
}

.shop-description {
    margin: 10px 0;
    font-size: 0.9em;
    color: #777;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    max-height: 4.5em; /* Fallback for non-WebKit browsers: 3 lines × 1.5 line height */
}

.view-details-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.view-details-btn:hover {
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 20px auto;
    padding: 20px;
    max-width: 800px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #FFD700;
}

.modal-header h2 {
    color: #333;
    margin: 0;
    font-size: 1.8em;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #333;
}

/* Shop Gallery */
.shop-gallery {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.main-gallery-image {
    width: 100%;
    height: 400px;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
}

.main-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.thumbnail {
    flex: 0 0 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #4CAF50;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Shop Details */
.shop-details {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shop-details h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.shop-details p {
    margin: 12px 0;
    line-height: 1.6;
}

.shop-details i {
    width: 20px;
    color: #666;
    margin-right: 8px;
}

.shop-certifications {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.shop-certifications p {
    display: flex;
    align-items: center;
}

.shop-certifications i {
    color: #FFA500;
}

/* Image Preview */
.preview-image {
    position: relative;
    display: inline-block;
    margin: 10px;
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    cursor: pointer;
}

.preview-image:hover {
    transform: scale(1.05);
}

.preview-image.main-image {
    border: 3px solid #4CAF50;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2;
}

.set-main-image {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #FFD700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2;
    transition: background-color 0.2s;
}

.set-main-image:hover {
    background: rgba(0, 0, 0, 0.8);
}

.main-image .set-main-image {
    background: rgba(76, 175, 80, 0.8);
}

#imagePreview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header {
        padding: 15px;
    }

    .logo h1 {
        font-size: 36px;
    }

    .tagline {
        font-size: 16px;
    }

    .filters {
        flex-direction: column;
    }

    .filters select {
        width: 100%;
    }

    .shops-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .shop-card {
        max-width: 100%;
    }

    .modal-content {
        margin: 10px;
        padding: 15px;
    }

    .main-gallery-image {
        height: 300px;
    }

    .thumbnail {
        flex: 0 0 60px;
        height: 60px;
    }

    .shop-details {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 28px;
    }

    .tagline {
        font-size: 14px;
    }

    .search-section {
        padding: 15px;
    }

    #shopSearch {
        padding: 12px 12px 12px 40px;
        font-size: 14px;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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