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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.main-content {
    display: flex;
    gap: 20px;
    padding: 20px 30px;
}

#map {
    flex: 1;
    height: 600px;
    border-radius: 8px;
}

.places-panel {
    width: 350px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.panel-header h2 {
    color: #333;
    font-size: 1.5em;
}

.pick-random-btn {
    padding: 8px 16px;
    background: #f39c12;
    color: white;
    font-size: 14px;
}

.pick-random-btn:hover {
    background: #e67e22;
}

.places-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.place-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.place-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.place-item.active {
    border: 2px solid #e74c3c;
    background: #fdf2f1;
}

.place-item.winner {
    border: 3px solid #f39c12;
    background: #fef9e7;
    animation: pulse 1s ease-in-out 3;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.place-photo {
    margin: -15px -15px 12px -15px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.place-photo img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.place-item h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.1em;
}

.place-item .address {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.place-item .maps-link {
    margin-bottom: 8px;
}

.place-item .maps-link a {
    color: #4285f4;
    font-size: 0.85em;
    text-decoration: none;
}

.place-item .maps-link a:hover {
    text-decoration: underline;
}

.place-item .meta {
    margin-bottom: 8px;
    font-size: 0.95em;
}

.place-item .rating {
    color: #f39c12;
    font-weight: 600;
}

.place-item .price {
    color: #27ae60;
    font-weight: 600;
}

.place-item .hours {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.place-item .hours-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.place-item .hours-list {
    font-size: 0.85em;
    color: #666;
}

.place-item .hours-list div {
    margin-bottom: 3px;
}

.place-item .hours-status {
    font-weight: 600;
    margin-top: 5px;
    font-size: 0.9em;
}

.place-item .hours-status.open {
    color: #27ae60;
}

.place-item .hours-status.closed {
    color: #e74c3c;
}

.place-item .walking-distance {
    color: #e74c3c;
    font-weight: 600;
    margin-top: 8px;
    font-size: 0.9em;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    color: #e74c3c;
    font-size: 2em;
    margin-bottom: 20px;
}

#winnerDetails {
    text-align: left;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.winner-photo {
    margin: -20px -20px 15px -20px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.winner-photo img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

#winnerDetails h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #333;
}

#winnerDetails p {
    color: #666;
    margin: 5px 0;
}

.modal-content button {
    margin: 10px;
}

#closeModalBtn {
    background: #27ae60;
    color: white;
}

#rerollBtn {
    background: #95a5a6;
    color: white;
}

.info {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#status {
    color: #666;
    font-size: 14px;
}

.version {
    color: #999;
    font-size: 12px;
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    #map {
        flex: none;
        height: 50vh;
        min-height: 300px;
    }

    .places-panel {
        width: 100%;
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    header p {
        font-size: 0.95em;
    }

    .main-content {
        padding: 15px;
    }
}

/* Loading overlay background */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-overlay .loading-panel {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-overlay p {
    margin: 0;
    font-size: 1.1em;
    color: #555;
    font-weight: 500;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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