/* style.css */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-width: 600px;
}

button.main-btn {
    padding: 12px 25px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}


@media (max-width: 900px) { .gallery { column-count: 3; } }
@media (max-width: 600px) { .gallery { column-count: 2; } }

.item:hover { transform: scale(1.02); }

.info {
    padding: 12px;
    text-align: center;
}

.name {
    font-size: 13px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 500;
    word-break: break-word;
}

/* Nút bấm tải xuống */
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}
button:disabled {
    transition: all 0.5s ease;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}
/* style.css */
.btn-dl:disabled {
    /* Hiệu ứng xung nhịp để người dùng biết máy đang xử lý */
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { background-color: #4caf50; } /* Màu gốc của nút */
    50% { background-color: #81c784; } /* Nhạt đi một chút */
    100% { background-color: #4caf50; }
}
/* Đảm bảo text % nằm giữa nút */
.btn-dl {
    min-width: 80px; /* Cố định độ rộng tối thiểu để nút không bị co giãn khi hiện % */
    transition: all 0.2s ease;
}

.btn-dl:active {
    transform: scale(0.95); /* Hiệu ứng nhấn nút */
}

.btn-thumb { background-color: #34a853; } /* Màu xanh lá */
.btn-orig { background-color: #ea4335; }  /* Màu đỏ */
.btn-dl:hover { opacity: 0.8; }

.loader { display: none; text-align: center; margin: 20px; font-weight: bold; }



/* style.css */
.gallery {
    display: flex;
    flex-wrap: wrap; /* Cho phép các ảnh xếp hàng ngang */
    gap: 15px;
    justify-content: center;
}

.item {
    flex: 1 1 250px; /* Độ rộng tối thiểu 250px, tự giãn nếu có chỗ trống */
    max-width: 400px; /* Không để ảnh ngang bị giãn quá to */
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.img-container {
    width: 100%;
    height: 250px; /* Cố định khung chứa ảnh để hàng lối thẳng hàng */
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Hiện toàn bộ ảnh không bị mất góc */
}