:root {
    --primary-color: #ff6b6b; /* Coral Red */
    --secondary-color: #48dbfb; /* Sky Blue */
    --accent-color: #feca57; /* Orange Yellow */
    --text-color: #ffffff;
    --background-light: #000000;
    --background-dark: #000000;
    --card-background: #1a1a1a;
    --border-color: #444444;
    --shadow: rgba(255, 255, 255, 0.1);
    --modal-overlay-color: rgba(0, 0, 0, 0.9);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-light);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    background-color: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow);
    padding: 30px;
    margin: 30px 20px;
    width: 100%;
    max-width: 900px;
    text-align: center;
    animation: fadeIn 1s ease-out;
    box-sizing: border-box;
    flex-shrink: 0;
}

h1 {
    color: var(--primary-color);
    font-size: 2.8em;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
}

h1::after {
    content: '';
    display: block;
    width: 60%;
    height: 4px;
    background-color: var(--secondary-color);
    margin: 0 auto;
    border-radius: 2px;
    animation: underlineGrow 1.5s ease-out forwards;
}

.tagline {
    font-size: 1.2em;
    color: #cccccc;
    margin-bottom: 30px;
}

.gamification-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    background-color: #222222;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #444444;
    box-shadow: inset 0 1px 5px rgba(255,255,255,0.05);
}

.gamification-stats p {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.gamification-stats p i {
    color: var(--accent-color);
    margin-right: 8px;
    font-size: 1.2em;
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    background-color: #111111;
    padding: 28px;
    border-radius: 16px;
    box-shadow: inset 0 2px 5px var(--shadow);
    align-items: center;
    justify-content: center;
}

.input-group input[type="text"] {
    flex-grow: 1;
    min-width: 220px;
    padding: 16px 20px;
    border: 2px solid var(--secondary-color);
    border-radius: 25px;
    background-color: var(--card-background);
    font-size: 1.1rem;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
}

.input-group input[type="text"]::placeholder {
    color: #999999;
}

.input-group input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}

.input-group button {
    padding: 16px 28px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

.input-group button:hover:not(:disabled) {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(72, 219, 251, 0.4);
}

.input-group button:disabled {
    background-color: #666666;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px var(--shadow);
    border: 2px solid var(--border-color);
    overflow: hidden;
}

#results-container h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2em;
}

#current-search-location {
    color: var(--accent-color);
}

#restaurant-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 10px;
}

.restaurant-card {
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 6px 20px var(--shadow);
    padding: 20px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.restaurant-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
}

.restaurant-card h3 {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.restaurant-card p {
    margin: 5px 0;
    color: #dddddd;
    font-size: 0.95em;
}

.restaurant-card .rating {
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.restaurant-card .rating::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    content: '\f005';
    margin-right: 5px;
    color: var(--accent-color);
}

.restaurant-card .open-now {
    font-weight: 600;
    color: #00ff00;
    display: block;
    margin-top: 5px;
}

.restaurant-card .closed-now {
    font-weight: 600;
    color: #ff0000;
    display: block;
    margin-top: 5px;
}

.restaurant-card img.place-photo {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.restaurant-card .view-more-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    margin-top: 15px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.restaurant-card .view-more-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(72, 219, 251, 0.4);
}

.initial-message {
    font-style: italic;
    color: #aaaaaa;
    margin-top: 30px;
    font-size: 1.1em;
}

.error-message {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 20px;
}

.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #bbbbbb;
    font-size: 0.9em;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--modal-overlay-color);
    justify-content: center;
    align-items: center;
    animation: fadeInModal 0.3s ease-out forwards;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--card-background);
    margin: auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.3);
    width: 90%;
    max-width: 800px;
    position: relative;
    animation: slideInUp 0.4s ease-out forwards;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-align: center;
}

#modal-place-name {
    color: var(--primary-color);
    margin: 0;
    font-size: 2.2em;
}

.close-button {
    color: #dddddd;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--primary-color);
    text-decoration: none;
}

.modal-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
}

.place-info p {
    margin: 8px 0;
    display: flex;
    align-items: center;
    font-size: 1.05em;
}

.place-info p i {
    color: var(--secondary-color);
    margin-right: 10px;
    width: 20px;
}

.place-info a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.place-info a:hover {
    color: var(--primary-color);
}

#modal-reviews {
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 10px;
    width: 100%;
    box-sizing: border-box;
}

.review-item {
    background-color: #222222;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 10px;
    border: 1px solid #444444;
    font-size: 0.9em;
}

.review-item strong {
    color: var(--primary-color);
}

.review-item .review-rating {
    color: var(--accent-color);
    font-weight: 600;
    margin-left: 5px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

.action-btn i {
    margin-right: 8px;
}

.primary-action-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-action-btn:hover {
    background-color: #e65c5c;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}

.secondary-action-btn {
    background-color: #333333;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.secondary-action-btn:hover {
    background-color: #444444;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.2);
}

.slideshow-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 20px var(--shadow);
}

.slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slides img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    cursor: pointer;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
    z-index: 1;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

.dots-container {
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 4px;
    background-color: #bbbbbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.dot.active {
    background-color: var(--primary-color);
}

.image-modal-content {
    max-width: 90%;
    height: auto;
    padding: 10px;
    display: block;
    text-align: center;
    position: relative;
}

.lightbox-slideshow-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

#lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
    z-index: 2;
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0,0,0,0.8);
}

.lightbox-dots-container {
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes underlineGrow {
    from { width: 0; }
    to { width: 60%; }
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 20px 10px;
    }

    h1 {
        font-size: 2.2em;
    }

    .gamification-stats {
        flex-direction: column;
        gap: 10px;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    #map {
        height: 300px;
    }

    #restaurant-list {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }

    .tagline {
        font-size: 1em;
    }

    .slideshow-container {
        max-width: 100%;
    }

    .slides img {
        height: 200px;
    }
}