/* 台灣彩券外掛樣式 - 完全參考台彩官網設計 V2.2 */

/* ========== 主容器 ========== */
.twlottery-main {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

/* ========== 頁面標題 ========== */
.twlottery-page-header {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 30px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3);
}

.twlottery-page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    color: #2d3436;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* ========== 遊戲選擇器 ========== */
.twlottery-game-selector {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.game-selector-label {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 18px;
    text-align: center;
}

.game-icons-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.game-icon-item {
    background: #fff;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-icon-item:hover {
    border-color: #fdcb6e;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(253, 203, 110, 0.4);
}

.game-icon-item.active {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
    transform: scale(1.05);
}

.game-icon-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ========== 查詢表單 ========== */
.twlottery-query-panel {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.query-form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.query-field {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
}

.query-field-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 8px;
}

.query-select,
.query-input {
    padding: 12px 15px;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fff;
}

.query-select:focus,
.query-input:focus {
    outline: none;
    border-color: #fdcb6e;
    box-shadow: 0 0 0 3px rgba(253, 203, 110, 0.1);
}

.query-action {
    flex: 0 0 auto;
}

.btn-query-submit {
    background: linear-gradient(135deg, #ff9f43 0%, #ff6348 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 99, 72, 0.4);
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-query-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 99, 72, 0.6);
}

.btn-query-clear {
    background: #b2bec3;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-query-clear:hover {
    background: #636e72;
    transform: translateY(-2px);
}

/* ========== 結果區域 ========== */
.twlottery-results-area {
    min-height: 200px;
}

.tw-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-animation {
    width: 50px;
    height: 50px;
    border: 5px solid #f0f0f0;
    border-top-color: #fdcb6e;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tw-error {
    text-align: center;
    padding: 40px 20px;
    background: #fff5f5;
    border-radius: 8px;
    border: 2px solid #fab1a0;
}

.error-text {
    color: #d63031;
    font-size: 16px;
    margin-bottom: 15px;
}

.btn-retry {
    background: #d63031;
    color: #fff;
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.tw-empty {
    text-align: center;
    padding: 50px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #636e72;
    font-size: 15px;
}

/* ========== 開獎卡片 ========== */
.draw-card {
    background: #fff;
    border-left: 5px solid #fdcb6e;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.draw-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* 卡片頭部 */
.draw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ffeaa7;
}

.draw-period {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    color: #2d3436;
}

.draw-date {
    font-size: 14px;
    color: #636e72;
    font-weight: 600;
}

/* 號碼區 */
.draw-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.number-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.number-label {
    display: inline-block;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(253, 203, 110, 0.3);
}

.number-balls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 號碼球 - 橙色 */
.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ff9f43 0%, #ff6348 40%, #ff9f43 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    border-radius: 50%;
    box-shadow: 
        0 4px 8px rgba(255, 99, 72, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    border: 3px solid #fff;
    position: relative;
}

.ball::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 10px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

/* 特別號 - 紅色 */
.ball.special-ball {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 40%, #ff6b6b 100%);
    box-shadow: 
        0 4px 8px rgba(238, 90, 111, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

/* 無資料 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #636e72;
    font-size: 16px;
    font-weight: 600;
}

/* ========== 舊樣式保留 ========== */
.lottery-container {
    margin: 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, #fffbea 0%, #fff9db 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #f5e6c8;
}

.lottery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.lottery-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.lottery-refresh-btn,
.lottery-retry-btn {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.lottery-refresh-btn:hover,
.lottery-retry-btn:hover {
    background: #005a87;
}

/* 載入動畫 */
.lottery-loading {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lottery-loading p {
    color: #666;
    font-size: 14px;
}

/* 錯誤訊息 */
.lottery-error {
    text-align: center;
    padding: 30px 20px;
    background: #fff3f3;
    border: 1px solid #ffcccc;
    border-radius: 4px;
}

.lottery-error .error-message {
    color: #d63638;
    margin-bottom: 15px;
    font-size: 14px;
}

/* 資料顯示區 - 卡片式設計 */
.lottery-results {
    animation: fadeIn 0.5s;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lottery-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 18px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #ffd93d;
}

.lottery-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.lottery-info strong {
    color: #333;
}

/* 表格樣式 - 參考台彩設計 */
.lottery-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.lottery-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
}

.lottery-table thead {
    background: linear-gradient(135deg, #ffd93d 0%, #fcbf49 100%);
    color: #333;
}

.lottery-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    border-right: 1px solid rgba(255,255,255,0.3);
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

.lottery-table th:last-child {
    border-right: none;
}

.lottery-table td {
    padding: 18px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    text-align: center;
    vertical-align: middle;
}

.lottery-table tbody tr {
    transition: all 0.3s ease;
    background: #fff;
}

.lottery-table tbody tr:hover {
    background: #fffbf0;
    transform: translateX(3px);
    box-shadow: -3px 0 0 #ffd93d;
}

.lottery-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.lottery-table tbody tr:nth-child(even):hover {
    background: #fffbf0;
}

/* 號碼樣式 - 參考台彩橘色球 */
.lottery-number {
    display: inline-block;
    width: 45px;
    height: 45px;
    line-height: 45px;
    text-align: center;
    background: linear-gradient(145deg, #ff9f43 0%, #ff6348 100%);
    color: #fff;
    border-radius: 50%;
    margin: 0 5px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 3px 8px rgba(255, 99, 72, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
    border: 3px solid #fff;
    position: relative;
}

.lottery-number::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), transparent);
    border-radius: 50%;
}

/* 無資料 */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* ==================== 進階查詢介面樣式 - 台彩風格 ==================== */

.lottery-query-interface {
    margin: 30px 0;
}

.lottery-query-form {
    background: linear-gradient(135deg, #ffd93d 0%, #fcbf49 100%);
    padding: 35px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(252, 191, 73, 0.3);
    margin-bottom: 30px;
    border: 2px solid #fff;
}

.lottery-query-form h2 {
    color: #2c3e50;
    margin: 0 0 30px 0;
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.5);
}

.query-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    background: rgba(255,255,255,0.95);
    padding: 25px;
    border-radius: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.lottery-select,
.lottery-input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s;
    background: #fff;
}

.lottery-select:focus,
.lottery-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-input-group input {
    flex: 1;
}

.date-input-group span {
    color: #666;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.lottery-query-button,
.lottery-clear-button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.lottery-query-button {
    background: linear-gradient(135deg, #ff6348 0%, #ff9f43 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.lottery-query-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.lottery-clear-button {
    background: #f5f5f5;
    color: #666;
}

.lottery-clear-button:hover {
    background: #e0e0e0;
}

.lottery-query-results {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    min-height: 200px;
}

.lottery-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.lottery-empty p {
    font-size: 18px;
}

.query-summary {
    background: linear-gradient(135deg, #fffbea 0%, #fff3cd 100%);
    border-left: 5px solid #ffd93d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.query-summary h3 {
    margin: 0 0 15px 0;
    color: #333;
}

/* 查詢結果表格增強 */
.lottery-query-results .lottery-table tbody tr.even {
    background: #f9f9f9;
}

.lottery-query-results .lottery-table tbody tr.odd {
    background: #fff;
}

.lottery-query-results .lottery-table tbody tr:hover {
    background: #f0f4ff;
    transform: scale(1.01);
    transition: all 0.2s;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .lottery-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lottery-header h2 {
        margin-bottom: 10px;
        font-size: 20px;
    }
    
    .lottery-table {
        font-size: 12px;
    }
    
    .lottery-table th,
    .lottery-table td {
        padding: 8px;
    }
    
    .lottery-number {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 12px;
    }
    
    .query-form-grid {
        grid-template-columns: 1fr;
    }
    
    .lottery-query-form h2 {
        font-size: 22px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .lottery-query-button,
    .lottery-clear-button {
        width: 100%;
    }
}

/* ========== 新版響應式設計 ========== */
@media (max-width: 768px) {
    .twlottery-page-title {
        font-size: 22px;
    }
    
    .game-icons-grid {
        gap: 10px;
    }
    
    .game-icon-item {
        width: 70px;
        height: 70px;
        padding: 5px;
    }
    
    .query-form-row {
        flex-direction: column;
    }
    
    .query-field {
        width: 100%;
    }
    
    .btn-query-submit,
    .btn-query-clear {
        width: 100%;
    }
    
    .draw-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .draw-numbers {
        flex-direction: column;
        gap: 15px;
    }
    
    .number-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ball {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .game-icon-item {
        width: 60px;
        height: 60px;
    }
    
    .ball {
        width: 35px;
        height: 35px;
        font-size: 15px;
    }
}
