/* ===================================
   花蓮縣苗木線上申請系統 - 查詢頁面樣式
   query.css
   =================================== */

/* ===================================
   查詢區塊
   =================================== */
.query-section {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #f8fffe 0%, #f0f9f7 100%);
    min-height: calc(100vh - 120px);
}

.query-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 48px;
}

.section-description {
    text-align: center;
    color: var(--dark-gray);
    font-size: 1rem;
    margin-bottom: 32px;
}

/* ===================================
   Tab 切換樣式
   =================================== */
.query-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    border-bottom: 2px solid #E0E0E0;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--dark-gray);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-green);
    background: rgba(73, 144, 164, 0.05);
}

.tab-btn.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
    font-weight: 600;
}

.tab-icon {
    font-size: 1.25rem;
}

/* ===================================
   查詢表單樣式
   =================================== */
.query-form-wrapper {
    position: relative;
    min-height: 200px;
}

.query-form {
    display: none;
    animation: fadeIn 0.4s ease;
}

.query-form.active {
    display: block;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.938rem;
}

.required {
    color: #E74C3C;
    margin-left: 4px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(73, 144, 164, 0.1);
}

.form-input::placeholder {
    color: #B0B0B0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 20px;
    color: var(--dark-gray);
    font-size: 0.875rem;
    padding: 12px 16px;
    background: #F0F9F7;
    border-left: 3px solid var(--primary-green);
    border-radius: 4px;
}

.hint-icon {
    font-size: 1rem;
}

.btn-query {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: 600;
}

.btn-icon {
    font-size: 1.25rem;
}

/* ===================================
   查詢結果區樣式
   =================================== */
.query-result {
    margin-top: 48px;
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section-title {
    font-size: 1.5rem;
    color: var(--text-blue);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-green);
}

.result-card {
    background: var(--white);
    border: 1px solid #E8E8E8;
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

/* ===================================
   申請狀態時間軸
   =================================== */
.status-timeline {
    background: linear-gradient(135deg, #f8fffe 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding-top: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 38px;
    height: 2px;
    background: #E0E0E0;
    z-index: 1;
}

.timeline-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    top: 10px;
    border-radius: 50%;
    background: #F5F5F5;
    border: 3px solid #E0E0E0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #999;
    font-weight: bold;
    z-index: 2;
    position: relative;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.timeline-item.completed .timeline-icon {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: var(--white);
}

.timeline-item.active .timeline-icon {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: var(--white);
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(245, 169, 98, 0.4);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 169, 98, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(245, 169, 98, 0);
    }
}

.timeline-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    width: 4rem;
}

.timeline-date {
    font-size: 0.813rem;
    color: var(--dark-gray);
}

/* ===================================
   資訊網格
   =================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

.info-label {
    font-size: 0.875rem;
    color: var(--dark-gray);
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-individual {
    background: #E8F4F8;
    color: #2196F3;
}

.badge-organization {
    background: #FFF4E5;
    color: #FF9800;
}

.badge-pending {
    background: #FFF9E6;
    color: #FFA726;
}

.badge-approved {
    background: #E8F5E9;
    color: #4CAF50;
}

.badge-rejected {
    background: #FFEBEE;
    color: #F44336;
}

/* ===================================
   詳細內容區
   =================================== */
.detail-section {
    margin-bottom: 32px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-blue);
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 4px solid var(--primary-green);
}

.detail-content {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.8;
    padding: 16px;
    background: #F8F9FA;
    border-radius: var(--radius-md);
}

/* ===================================
   苗木清單表格
   =================================== */
.seedling-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid #E0E0E0;
}

.seedling-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.seedling-table thead {
    background: linear-gradient(135deg, #4990a4 0%, #3D8AB0 100%);
    color: var(--white);
}

.seedling-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.938rem;
}

.seedling-table tbody tr {
    border-bottom: 1px solid #F0F0F0;
    transition: background 0.2s ease;
}

.seedling-table tbody tr:hover {
    background: #F8FFFE;
}

.seedling-table td {
    padding: 16px;
    font-size: 0.938rem;
    color: var(--text-dark);
}

.seedling-table tfoot {
    background: #F8F9FA;
    font-weight: 600;
}

.seedling-table tfoot td {
    padding: 16px;
}

.text-muted {
    color: var(--dark-gray);
}

/* ===================================
   附件列表
   =================================== */
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #F8F9FA;
    border: 1px solid #E8E8E8;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.attachment-item:hover {
    background: #F0F9F7;
    border-color: var(--primary-green);
    box-shadow: var(--shadow-sm);
}

.attachment-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.attachment-meta {
    font-size: 0.875rem;
    color: var(--dark-gray);
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--primary-green);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.938rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-download:hover {
    background: #3D8AB0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.download-icon {
    font-size: 1.125rem;
}

/* ===================================
   審核歷程
   =================================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    padding: 16px;
    background: #F8F9FA;
    border-left: 4px solid var(--primary-green);
    border-radius: var(--radius-md);
}

.history-time {
    font-size: 0.875rem;
    color: var(--dark-gray);
    font-weight: 600;
    align-self: start;
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-action {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

.history-operator {
    font-size: 0.875rem;
    color: var(--dark-gray);
}

.highlight {
    color: var(--primary-green);
    font-weight: 600;
}

/* ===================================
   操作按鈕區
   =================================== */
.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #F0F0F0;
}

.btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary-green);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--white);
    color: var(--dark-gray);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-outline:hover {
    border-color: var(--dark-gray);
    background: #F8F9FA;
    color: var(--text-dark);
}

/* ===================================
   查無資料提示
   =================================== */
.no-result {
    text-align: center;
    padding: 60px 32px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-top: 32px;
}

.no-result-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.3;
}

.no-result-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.no-result-message {
    font-size: 1rem;
    color: var(--dark-gray);
    line-height: 1.8;
    margin-bottom: 32px;
}

.no-result-tips {
    text-align: left;
    max-width: 500px;
    margin: 0 auto 32px;
    padding: 24px;
    background: #F8F9FA;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-orange);
}

.no-result-tips h4 {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.no-result-tips ul {
    list-style: none;
    padding: 0;
}

.no-result-tips li {
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
    color: var(--dark-gray);
    font-size: 0.938rem;
}

.no-result-tips li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--primary-orange);
    font-weight: bold;
}

.no-result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ===================================
   動畫效果
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===================================
   RWD 響應式設計
   =================================== */

/* 平板 */
@media (max-width: 1024px) {
    .query-container {
        padding: 36px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .history-item {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }
}

/* 手機 */
@media (max-width: 768px) {
    .query-section {
        padding: 60px 0 40px;
    }

    .query-container {
        padding: 24px;
        border-radius: var(--radius-md);
    }

    .section-title {
        font-size: 1.75rem;
    }

    .query-tabs {
        flex-direction: column;
        gap: 0;
        border-bottom: none;
    }

    .tab-btn {
        border-bottom: 1px solid #E0E0E0;
        border-radius: 0;
        padding: 14px 20px;
    }

    .tab-btn:first-child {
        border-top-left-radius: var(--radius-md);
        border-top-right-radius: var(--radius-md);
    }

    .tab-btn:last-child {
        border-bottom-left-radius: var(--radius-md);
        border-bottom-right-radius: var(--radius-md);
    }

    .tab-btn.active {
        background: rgba(73, 144, 164, 0.1);
        border-left: 4px solid var(--primary-green);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .result-card {
        padding: 20px;
    }

    .result-section-title {
        font-size: 1.25rem;
    }

    .status-timeline {
        padding: 20px;
    }

    .timeline {
        flex-direction: column;
        gap: 20px;
        padding-top: 0;
    }

    .timeline::before {
        display: none;
    }

    .timeline-item {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: 12px;
    }

    .timeline-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .timeline-content {
        align-items: flex-start;
    }

    .timeline-title {
        font-size: 0.938rem;
    }

    .timeline-date {
        font-size: 0.75rem;
    }

    .seedling-table {
        font-size: 0.875rem;
    }

    .seedling-table th,
    .seedling-table td {
        padding: 12px 8px;
    }

    .attachment-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-secondary,
    .btn-outline {
        width: 100%;
    }

    .no-result {
        padding: 40px 20px;
    }

    .no-result-icon {
        font-size: 3rem;
    }

    .no-result-title {
        font-size: 1.25rem;
    }

    .no-result-actions {
        flex-direction: column;
    }

    .no-result-actions .btn-primary,
    .no-result-actions .btn-outline {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .query-container {
        padding: 16px;
    }

    .tab-btn {
        font-size: 0.938rem;
        padding: 12px 16px;
    }

    .btn-query {
        font-size: 1rem;
        padding: 14px 24px;
    }
}
