/* ============================================================
   COMPONENTS.CSS - Buttons, Forms, Cards, Badges, Pagination
   ============================================================ */

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    line-height: 1;
}
.btn-lg { padding: 13px 30px; font-size: 15px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(231,76,60,0.35);
}

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.btn-dark {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}
.btn-dark:hover { background: #111; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--dark);
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
    height: 44px;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(231,76,60,0.1);
}
textarea.form-control { height: auto; resize: vertical; }

select.form-control {
    background-color: white;
    color: var(--dark);
    cursor: pointer;
}
select.form-control option {
    background-color: white;
    color: var(--dark);
}
select.form-control option:checked {
    background-color: var(--primary);
    color: white;
}

/* ===== PROPERTY CARDS ===== */
.property-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.property-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    border: 1px solid var(--border);
}
.property-card:hover {
    transform: var(--card-hover-transform);
    box-shadow: var(--shadow-md);
}

.card-img {
    height: 200px;
    background: #E8ECEF;
    position: relative;
    overflow: hidden;
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.property-card:hover .card-img img {
    transform: scale(1.05);
}

/* Heart Button (Quan tâm) */
.btn-favorite {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    color: #64748b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 12px;
    font-weight: 600;
}
.btn-favorite::after {
    content: 'Lưu';
}
.btn-favorite:hover {
    transform: translateY(-2px);
    background: #fff;
    color: var(--primary);
}
.btn-favorite.active {
    color: white;
    background: var(--primary);
}
.btn-favorite.active i {
    animation: heartBeat 0.3s ease-in-out;
}
@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8ECEF, #D5DBE1);
    color: #9AA5B1;
    font-size: 48px;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}
.card-badge--sale { background: var(--primary); color: white; }
.card-badge--rent { background: var(--info); color: white; }
.card-badge--hot { background: #FF6B35; color: white; }

.card-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.25s;
}
.property-card:hover .card-img-overlay { opacity: 1; }

.card-body { padding: 16px; }
.card-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.badge-nego {
    font-size: 10px;
    font-weight: 700;
    background: var(--success-light);
    color: var(--success);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.card-location {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.card-location i { color: var(--primary); font-size: 12px; }

.card-specs {
    display: flex;
    gap: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--gray);
}
.card-spec {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.card-spec i { color: var(--primary); font-size: 12px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.empty-state i {
    font-size: 56px;
    color: #D5DBE1;
    margin-bottom: 16px;
    display: block;
}
.empty-state h3 { font-size: 20px; color: var(--dark); margin-bottom: 8px; }
.empty-state p { color: var(--gray); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    background: white;
    font-size: 13px;
}
.breadcrumb a { color: var(--gray); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--dark); font-weight: 500; }
.breadcrumb-sep { margin: 0 8px; color: var(--border); }

/* ===== SIDEBAR ===== */
.sidebar-card {
    background: white;
    padding: 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    height: fit-content;
}
.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-title i { color: var(--primary); }

/* ===== PAGINATION ===== */
nav[role="navigation"] {
    margin-top: 32px;
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.page-link, span[aria-current="page"] span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.page-link { color: var(--dark); background: white; border: 1px solid var(--border); }
.page-link:hover { background: var(--primary); color: white; border-color: var(--primary); }
span[aria-current="page"] span {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

/* ===== SORT SELECT ===== */
.sort-select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--dark);
    background: white;
    cursor: pointer;
}
.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== RESPONSIVE CARDS ===== */
@media (max-width: 1024px) {
    .property-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .property-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .card-price { font-size: 18px; }
}
@media (max-width: 576px) {
    .property-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .btn { padding: 9px 16px; font-size: 13px; }
}