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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.controls label {
    font-weight: bold;
    margin-right: 10px;
}

.controls select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

.controls select:focus {
    outline: none;
    border-color: #3498db;
}

/* Calendar Container */
.calendar-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.calendar-header button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s;
}

.calendar-header button:hover {
    background: #2980b9;
}

.calendar-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
}

/* Calendar Grid */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.calendar-day {
    background: white;
    min-height: 80px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.other-month {
    background: #f5f5f5;
    color: #bbb;
}

.calendar-day.has-shops {
    background: #e8f5e8;
    border-left: 4px solid #27ae60;
}

.calendar-day.has-shops:hover {
    background: #d4ecd4;
}

.calendar-day.selected {
    background: #3498db;
    color: white;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.shop-count {
    font-size: 12px;
    color: #666;
    margin-top: auto;
}

.calendar-day.has-shops .shop-count {
    color: #27ae60;
    font-weight: bold;
}

/* Day of Week Headers */
.calendar::before {
    content: "日 月 火 水 木 金 土";
    display: block;
    grid-column: 1 / -1;
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    letter-spacing: 2rem;
    text-indent: 1rem;
}

/* Shop Details */
.shop-details {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.shop-details h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.shop-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.shop-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.shop-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.shop-menu {
    color: #7f8c8d;
    margin-bottom: 5px;
}

.shop-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.shop-hours {
    font-size: 0.9rem;
    color: #95a5a6;
}

.shop-market {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.shop-url {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}

.shop-url:hover {
    text-decoration: underline;
}

/* Legend */
.legend {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

.legend h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 10px;
    border: 1px solid #ddd;
}

.color-box.has-shops {
    background: #e8f5e8;
    border-left: 4px solid #27ae60;
}

.color-box.no-shops {
    background: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls label {
        margin-bottom: 5px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 5px;
    }
    
    .calendar::before {
        letter-spacing: 1rem;
        text-indent: 0.5rem;
        padding: 10px;
    }
    
    .shop-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .calendar {
        gap: 0;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 3px;
        font-size: 0.8rem;
    }
    
    .calendar-header button {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .calendar-header h2 {
        font-size: 1.4rem;
    }
}
