/* 用戶查詢頁面專用樣式 */

.query-container {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

/* 歡迎區域 */
.welcome-section {
    padding: 60px 20px;
    text-align: center;
    color: white;
}

.welcome-content h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-content p {
    font-size: 20px;
    font-weight: 400;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 查詢區域 */
.search-section {
    padding: 0 20px 60px;
    display: flex;
    justify-content: center;
}

.search-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 600px;
    width: 100%;
    position: relative;
    top: -30px;
}

.search-header {
    text-align: center;
    margin-bottom: 32px;
}

.search-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.search-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 查詢標籤 */
.search-tabs {
    display: flex;
    background: var(--light-gray);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.tab-btn:hover:not(.active) {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
}

/* 查詢內容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--medium-gray);
    border-radius: 12px;
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

.input-hint {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-hint i {
    color: var(--primary-color);
}

/* 查詢按鈕 */
.search-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.search-btn {
    flex: 1;
    padding: 16px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.clear-btn {
    padding: 16px 24px;
    background: var(--light-gray);
    color: var(--text-secondary);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-btn:hover {
    background: var(--medium-gray);
    color: var(--text-primary);
}

/* 查詢結果區域 */
.results-section {
    background: white;
    margin: 0 20px 40px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header {
    padding: 24px 32px;
    background: var(--light-gray);
    border-bottom: 1px solid var(--medium-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-count {
    font-size: 14px;
    color: var(--text-secondary);
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--medium-gray);
}

.results-container {
    padding: 24px 32px;
}

/* 帳單卡片 */
.bill-card {
    border: 1px solid var(--medium-gray);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
    cursor: pointer;
}

.bill-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
    transform: translateY(-2px);
}

.bill-card:last-child {
    margin-bottom: 0;
}

.bill-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.bill-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.bill-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.bill-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.bill-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.bill-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bill-info-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.bill-info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.bill-amount {
    text-align: right;
    padding-top: 16px;
    border-top: 1px solid var(--medium-gray);
}

.bill-amount-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.bill-amount-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 帳單詳情模態框 */
.bill-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.bill-detail-section {
    background: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bill-detail-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bill-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.bill-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bill-detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.bill-detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.bill-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.bill-items-table th,
.bill-items-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

.bill-items-table th {
    background: white;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
}

.bill-items-table td {
    font-size: 14px;
    color: var(--text-primary);
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    background: white;
    margin: 0 20px 40px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 32px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 載入指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 48px;
    margin-bottom: 16px;
}

.loading-spinner p {
    font-size: 16px;
    font-weight: 500;
}

/* 頁腳 */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 40px 20px 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
}

.footer-section p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
}

.footer-section ul li:before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.footer-bottom {
    max-width: 1200px;
    margin: 32px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    font-size: 14px;
    opacity: 0.6;
}

/* 管理員按鈕 */
.admin-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .welcome-content h1 {
        font-size: 36px;
    }
    
    .welcome-content p {
        font-size: 18px;
    }
    
    .search-card {
        padding: 24px;
        margin: 0 16px;
        top: -20px;
    }
    
    .search-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .results-section {
        margin: 0 16px 40px;
    }
    
    .results-header {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .results-container {
        padding: 20px;
    }
    
    .bill-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .bill-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .bill-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .empty-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}