/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #77B55A 0%, #5a9140 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Header */
.header {
    margin-bottom: 1rem;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nightlife-link-section {
    display: flex;
    align-items: center;
}

.btn-nightlife {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-nightlife:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #357ABD 0%, #2968A3 100%);
}

.title-section {
    flex: 1;
    text-align: center;
}

.title-with-inline-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sitcon-logo-inline {
    height: 2.2em;
    width: auto;
    vertical-align: middle;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.time-selector-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.time-selector-header label {
    font-weight: 500;
    white-space: nowrap;
}

.time-selector-header select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    color: #333;
    font-family: inherit;
    font-weight: 500;
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 0.6s ease-out;
    transform: translateY(0);
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.step-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #4a5568;
    text-align: center;
}

/* Input Styles */
.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-group input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #77B55A;
    box-shadow: 0 0 0 3px rgba(119, 181, 90, 0.1);
}

/* Button Styles */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #77B55A 0%, #5a9140 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(119, 181, 90, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    transform: translateY(-2px);
}

.btn-tertiary {
    background: transparent;
    color: #666;
    border: 2px solid #e2e8f0;
}

.btn-tertiary:hover {
    background: #f0f0f0;
    color: #333;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.restart-corner {
    position: relative;
    margin-top: 1rem;
    text-align: right;
}

/* People Selection */
.people-selector {
    text-align: center;
}

.people-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.people-input-group label {
    font-weight: 500;
    color: #4a5568;
}

.people-input-group input[type="number"] {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.2rem;
    font-family: inherit;
    width: 120px;
    text-align: center;
}

.people-input-group input[type="number"]:focus {
    outline: none;
    border-color: #77B55A;
    box-shadow: 0 0 0 3px rgba(119, 181, 90, 0.1);
}

.people-unit {
    font-weight: 500;
    color: #4a5568;
}

.people-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.people-btn {
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.people-btn:hover,
.people-btn.active {
    background: #77B55A;
    color: white;
    border-color: #77B55A;
    transform: translateY(-2px);
}

.people-btn.ricky-special {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border: 2px solid #ff6b6b;
    font-weight: bold;
}

.people-btn.ricky-special:hover,
.people-btn.ricky-special.active {
    background: linear-gradient(135deg, #ff5252 0%, #ff7043 100%);
    border-color: #ff5252;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.time-selector input[type="time"] {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-family: inherit;
}

.time-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.time-btn {
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.time-btn:hover,
.time-btn.active {
    background: #77B55A;
    color: white;
    border-color: #77B55A;
    transform: translateY(-2px);
}

/* Loading Animations */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: #666;
}

.spinner {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #77B55A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
    flex-grow: 0;
}

/* Restaurant Roulette */
.restaurant-roulette {
    text-align: center;
}

.roulette-container {
    margin: 2rem 0;
    perspective: 1000px;
}

.restaurant-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 16px;
    padding: 2rem;
    margin: 0 auto;
    max-width: 400px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.restaurant-card.spinning {
    animation: cardSpin 2s ease-in-out;
}

.restaurant-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3748;
}

.restaurant-info {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.selection-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Result Section */
.result-container {
    display: grid;
    gap: 2rem;
}

.restaurant-result {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.restaurant-result .name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3748;
}

.restaurant-result .details {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.restaurant-result .detail {
    padding: 0.5rem;
    background: rgba(119, 181, 90, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
}

.map-container {
    background: #f0f0f0;
    border-radius: 16px;
    height: 300px;
    overflow: hidden;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    pointer-events: none;
}

.map-container iframe {
    pointer-events: none;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Error Section */
.error-section {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.error-content h2 {
    color: #e53e3e;
    margin-bottom: 1rem;
}

.error-content p {
    color: #666;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes cardSpin {
    0% { transform: rotateY(0deg) scale(1); }
    25% { transform: rotateY(90deg) scale(0.8); }
    50% { transform: rotateY(180deg) scale(0.8); }
    75% { transform: rotateY(270deg) scale(0.8); }
    100% { transform: rotateY(360deg) scale(1); }
}

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

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .step {
        padding: 3rem;
    }
    
    .result-container {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        max-width: 100%;
        align-items: start;
    }
    
    .map-container {
        height: 300px;
        width: 100%;
    }
    
    .input-group {
        max-width: 600px;
        margin: 0 auto 1rem;
    }
    
    .result-actions {
        grid-column: 1 / -1;
        justify-content: center;
    }
    
    .restart-corner {
        grid-column: 1 / -1;
        display: flex;
        justify-content: flex-end;
        margin-top: 1rem;
    }
}

@media (max-width: 767px) {
    .header h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .title-with-inline-logo {
        flex-direction: row;
        gap: 0.4rem;
        align-items: center;
        justify-content: center;
    }
    
    .sitcon-logo-inline {
        height: 2.2em;
        flex-shrink: 0;
    }
    
    .time-selector-header {
        order: 2;
        justify-content: center;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .time-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-actions {
        flex-direction: column;
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .restart-corner {
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .map-container {
        display: none;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

/* Animation for restaurant selection */
.restaurant-card.highlighting {
    animation: pulse 0.5s ease-in-out;
    background: linear-gradient(135deg, #77B55A 0%, #5a9140 100%);
    color: white;
}

/* Special mobile styles */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .step {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .header {
        margin-bottom: 0.8rem;
    }
    
    .header h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .title-with-inline-logo {
        flex-wrap: nowrap;
    }
    
    .sitcon-logo-inline {
        height: 2em;
    }
    
    .restaurant-card {
        padding: 1rem;
    }
    
    .restaurant-name {
        font-size: 1.1rem;
    }
    
    .people-presets {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .people-btn {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
}