@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600&display=swap');

/* --- Admin Form --- */
.admin-box {
    background: #e8f5e9;
    border: 1px dashed #4caf50;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 10px;
    margin-top: 15px;
}

.form-control {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Sarabun', sans-serif;
    outline: none;
}

.btn-save {
    background: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-save:hover { background: #43a047; }

/* --- Grid แสดงผล --- */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

/* --- Card ดีไซน์ --- */
.site-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.site-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #009688;
}

/* ส่วนหัวการ์ด (Icon) */
.card-header {
    background: #e0f2f1;
    padding: 20px;
    text-align: center;
    color: #009688;
}

.card-icon {
    font-size: 40px;
}

/* ส่วนเนื้อหา */
.card-body {
    padding: 20px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.site-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* ปุ่มเปิดเว็บ */
.btn-visit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #009688;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 50px;
    transition: 0.3s;
    font-size: 14px;
}
.btn-visit:hover {
    background: #00796b;
    box-shadow: 0 4px 10px rgba(0, 150, 136, 0.3);
}

/* ปุ่มลบ (มุมขวาบน) */
.btn-delete-card {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff5252;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 14px;
    opacity: 0;
    transition: 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.site-card:hover .btn-delete-card {
    opacity: 1;
}

.btn-delete-card:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #999;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #eee;
}

/* Responsive */
@media (max-width: 768px) {
    .input-group {
        grid-template-columns: 1fr;
    }
    .btn-delete-card {
        opacity: 1; /* มือถือโชว์ปุ่มลบตลอด */
    }
}