/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

  /* 站點連結樣式 */                                                                      
  .station-link {                                                                                
      color: inherit;                                                                            
      text-decoration: none;                                                                     
      transition: color 0.3s ease;                                                               
  }                                                                                              
                                                                                                 
  .station-link:hover {                                                                          
      color: #007bff;                                                                            
      text-decoration: underline;                                                                
  }                                                                                              
                                                                                                 
  .station-link:visited {                                                                        
      color: inherit;                                                                            
  }   

/* 登入頁面樣式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-box h2 {
    color: #666;
    margin-bottom: 30px;
    font-size: 20px;
    font-weight: normal;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.error-message {
    background: #ff6b6b;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}


/* 主頁樣式 */
.dashboard-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.header h1 {
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-section {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.welcome-section h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
}

.welcome-section p {
    color: #666;
    margin-bottom: 20px;
    font-size: 18px;
}

/* 篩選功能樣式 */
.filter-section {
    margin-bottom: 30px;
}

.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.area-filter {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.area-filter:focus {
    outline: none;
    border-color: #667eea;
}

.clear-filter {
    padding: 12px 20px;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-filter:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

.station-card.hidden {
    display: none;
}

/* 站點網格佈局 */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
    padding: 0 20px;
}

.station-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.station-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.station-info {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 2px solid #667eea;
}

.station-name {
    color: #667eea;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.station-addr {
    color: #666;
    margin: 0;
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

.station-image {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.station-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.station-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.station-card:hover .station-image img {
    transform: scale(1.05);
    opacity: 0.9;
}

.station-image a:hover img {
    filter: brightness(1.1);
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .stations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .main-content {
        padding: 15px 5px;
    }
    
    .welcome-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .welcome-section h2 {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .welcome-section p {
        font-size: 16px;
    }
    
    .stations-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 5px;
    }
    
    .station-card {
        margin-bottom: 10px;
    }
    
    .station-info {
        padding: 12px;
    }
    
    .station-name {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .station-addr {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .station-image {
        height: 180px;
    }
    
    /* 篩選功能手機端優化 */
    .filter-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-input {
        min-width: 100%;
        font-size: 16px; /* 防止 iOS 縮放 */
    }
    
    .area-filter {
        width: 100%;
        font-size: 16px;
    }
    
    .clear-filter {
        width: 100%;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 10px;
    }
    
    .login-box {
        padding: 25px 20px;
    }
    
    .login-box h1 {
        font-size: 24px;
    }
    
    .login-box h2 {
        font-size: 18px;
    }
    
    .header {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .main-content {
        padding: 10px 3px;
    }
    
    .welcome-section {
        padding: 12px;
    }
    
    .welcome-section h2 {
        font-size: 20px;
    }
    
    .welcome-section p {
        font-size: 14px;
    }
    
    .stations-grid {
        gap: 12px;
        padding: 0 3px;
    }
    
    .station-info {
        padding: 10px;
    }
    
    .station-name {
        font-size: 15px;
    }
    
    .station-addr {
        font-size: 12px;
    }
    
    .station-image {
        height: 160px;
    }
    
    /* 小手機篩選功能優化 */
    .welcome-section p {
        font-size: 14px;
        text-align: center;
    }
    
    .filter-controls {
        gap: 10px;
    }
    
    .search-input, .area-filter, .clear-filter {
        padding: 10px 14px;
        font-size: 15px;
    }
}
