/* หน้าแสดงประวัติการต่อภาษี */
.cartax-container {
    font-family: 'Prompt', 'Kanit', sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 15px 12px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ส่วนหัว */
.cartax-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.cartax-title {
    color: #0a3677;
    margin: 0;
    font-weight: 700;
    font-size: 20px;
    padding-bottom: 0;
    position: relative;
    display: inline-block;
}

.cartax-title:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #0a3677, #f57c00);
    border-radius: 3px;
}

/* ปุ่มเล็ก */
.cartax-btn-small {
    background: linear-gradient(135deg, #134e94 0%, #0a3677 100%);
    color: white !important;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(10, 54, 119, 0.2);
    display: flex;
    align-items: center;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.cartax-btn-small:hover {
    background: linear-gradient(135deg, #0a3677 0%, #072a5c 100%);
    box-shadow: 0 2px 5px rgba(10, 54, 119, 0.3);
    transform: translateY(-1px);
}

/* ตาราง */
.cartax-table-wrapper {
    overflow-x: auto;
    margin-bottom: 0;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.cartax-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #fff;
    overflow: hidden;
}

.cartax-table th {
    background: linear-gradient(135deg, #134e94 0%, #0a3677 100%);
    color: white;
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

.cartax-table th:first-child {
    border-top-left-radius: 8px;
}

.cartax-table th:last-child {
    border-top-right-radius: 8px;
}

.cartax-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cartax-table tr:hover td {
    background-color: #f8fafc;
}

.cartax-table tr:last-child td {
    border-bottom: none;
}

.cartax-table tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.cartax-table tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* เพิ่มสไตล์สำหรับ Badge */
.year-column {
    position: relative;
    display: flex;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 1.5s ease-in-out infinite;
}

.critical-badge {
    background-color: #d32f2f;
    box-shadow: 0 0 0 rgba(211, 47, 47, 0.4);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4);
    }
    70% {
        box-shadow: 0 0 0 4px rgba(211, 47, 47, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

/* สีตามเงื่อนไข */
.cartax-table .notice {
    background-color: #fff3e0;
    border-left: 3px solid #ff9800;
}

.cartax-table .warning {
    background-color: #ffe0b2;
    border-left: 3px solid #f57c00;
}

.cartax-table .critical {
    background-color: #ffebee;
    border-left: 3px solid #d32f2f;
}

.cartax-table .past-year {
    background-color: #f5f5f5;
    color: #757575;
    border-left: 3px solid #bdbdbd;
}

.cartax-loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 15px 0;
    font-size: 13px;
}

/* เพิ่มสไตล์สำหรับการแสดงจำนวนเงิน */
.cartax-table .money-column {
    font-weight: 600;
    color: #0a3677;
}

/* เพิ่มสไตล์สำหรับการแสดงวันที่ */
.cartax-table .date-column {
    color: #444;
}

.cartax-table .days-left {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    background-color: #e3f2fd;
    color: #0a3677;
}

.cartax-table .critical .days-left {
    background-color: #d32f2f;
    color: white;
}

.cartax-table .warning .days-left {
    background-color: #f57c00;
    color: white;
}

.cartax-table .notice .days-left {
    background-color: #ff9800;
    color: white;
}

.cartax-table .past-year .days-left {
    background-color: #bdbdbd;
    color: white;
}

/* Loading spinner */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10, 54, 119, 0.2);
    border-radius: 50%;
    border-top-color: #0a3677;
    display: inline-block;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.cartax-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.cartax-modal.active {
    display: flex;
    animation: modalBackdropFadeIn 0.3s ease;
}

@keyframes modalBackdropFadeIn {
    from { background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(0); }
    to { background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
}

.cartax-modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    padding: 25px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cartax-modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cartax-modal-close:hover {
    color: #f57c00;
    background-color: #fff3e0;
    transform: rotate(90deg);
}

.cartax-modal h3 {
    color: #0a3677;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

.cartax-modal h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #0a3677, #f57c00);
    border-radius: 3px;
}

/* ฟอร์ม */
.cartax-form-group {
    margin-bottom: 18px;
}

.cartax-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cartax-form-group input,
.cartax-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: #f9f9f9;
}

.cartax-form-group input:focus,
.cartax-form-group select:focus {
    border-color: #0a3677;
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 54, 119, 0.1);
    background-color: #fff;
}

.cartax-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    gap: 12px;
}

.cartax-submit-btn {
    background: linear-gradient(135deg, #134e94 0%, #0a3677 100%);
    color: white !important;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    box-shadow: 0 2px 5px rgba(10, 54, 119, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cartax-submit-btn:hover {
    background: linear-gradient(135deg, #0a3677 0%, #072a5c 100%);
    box-shadow: 0 4px 8px rgba(10, 54, 119, 0.3);
    transform: translateY(-2px);
}

.cartax-cancel-btn {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    color: white !important;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    box-shadow: 0 2px 5px rgba(230, 81, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cartax-cancel-btn:hover {
    background: linear-gradient(135deg, #e65100 0%, #bf360c 100%);
    box-shadow: 0 4px 8px rgba(230, 81, 0, 0.3);
    transform: translateY(-2px);
}

/* Responsive */
@media screen and (max-width: 576px) {
    .cartax-container {
        padding: 10px 8px;
        border-radius: 8px;
    }
    
    .cartax-title {
        font-size: 18px;
    }
    
    .cartax-btn-small {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .cartax-table th,
    .cartax-table td {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .cartax-form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .cartax-submit-btn,
    .cartax-cancel-btn {
        width: 100%;
    }
    
    .cartax-modal-content {
        padding: 20px 15px;
    }
}

/* การแจ้งเตือน */
#cartax-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.cartax-notification {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.cartax-notification.show {
    transform: translateX(0);
}

.cartax-notification.success {
    border-left: 4px solid #4CAF50;
}

.cartax-notification.error {
    border-left: 4px solid #F44336;
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

.success .notification-icon {
    background-color: #4CAF50;
    color: white;
}

.error .notification-icon {
    background-color: #F44336;
    color: white;
}

.notification-message {
    font-size: 14px;
    color: #333;
}

@media screen and (max-width: 576px) {
    #cartax-notification {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .cartax-notification {
        max-width: none;
    }
}