.main-content {
    padding: 120px 0 60px;
    min-height: 100vh;
}

.fade-transition {
    animation: fadeInUp 1s ease-out;
}

.filter-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.filter-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid var(--secondary-color);
    background: transparent;
    color: var(--accent-color);
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.confirm-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.history-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.history-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.images-container {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.history-image {
    flex: 1;
    height: 255px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    position: relative;
    overflow: hidden;
}

.history-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.history-info {
    text-align: center;
}

.history-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.history-time {
    font-size: 0.9rem;
    color: #666;
}

.history-card:hover .history-image img {
    transform: scale(1.05);
}

.history-info .history-status {
    margin-top: 10px;
    margin-bottom: 10px;
}

.history-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.history-status.detected {
    background-color: #dc3545;
}

.history-status.safe {
    background-color: #28a745;
}

.detection-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-detected {
    background: #dc3545;
    color: white;
}

.status-clear {
    background: #28a745;
    color: white;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.page-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--accent-color);
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 10px;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 0;
    width: 90%;
    max-width: 700px;
    max-height: 90%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px 30px;
    position: relative;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 25px;
    gap: 25px;
    background-color: #ffffff;
    border-radius: 0 0 10px 10px;
    position: relative;
}

.modal-images {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 90vw;
    height: auto;
    position: relative;
}

.modal-image {
    flex: 1;
    width: 100%;
    height: 250px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.modal-image img {
    max-width: 100%;
    max-height: 75vh;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    background-color: #f8f9fa;
}

.modal-info {
    background: var(--light-color);
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    text-align: left;
    padding: 0 10px;
}

.modal-info p.text-center {
    text-align: left;
    color: #666;
}

.modal-info h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color-light);
    padding-bottom: 8px;
}

.modal-info ul {
    list-style: none;
    padding-left: 0;
    margin-top: 15px;
}

.modal-info ul li {
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid var(--primary-color-light);
    line-height: 1.5;
}

.modal-info ul li strong {
    color: #333;
}

.image-label {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--dark-color);
}

.info-value {
    color: #666;
    text-align: right;
}

/* No Data */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-data i {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.no-data h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
}

.history-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.history-status.detected {
    background-color: #dc3545;
}

.history-status.safe {
    background-color: #28a745;
}

.modal.active {
    display: flex;
}

.history-image {
    height: 255px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.history-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.history-card:hover .history-image img {
    transform: scale(1.05);
}

.modal-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.history-info .history-status {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Loading animation */
.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 100px 0 40px;
    }

    .page-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .filter-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .filter-options {
        justify-content: center;
    }

    .filter-btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }

    .history-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .history-card {
        padding: 15px;
    }

    .images-container {
        gap: 10px;
        margin-bottom: 12px;
    }

    .history-image {
        height: 100px;
        font-size: 1.5rem;
    }

    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-images {
        flex-direction: column;
        gap: 15px;
    }

    .modal-image {
        height: 200px;
        font-size: 2rem;
    }

    .pagination {
        padding: 10px 20px;
        gap: 5px;
    }

    .page-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}