/* Global */
body {
    background: #ffffff; /* plain background supaya table sahaja ada gradient */
    min-height: 100vh;
    padding: 1rem;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #f5f5f5;
    animation: fadeIn 0.5s ease-in-out;
}

/* Container */
.container {
    max-width: 1200px;
    margin: auto;
}

/* Tajuk */
h2 {
    font-size: 1.7rem;
    font-weight: bold;
    margin-bottom: 1.2rem;
    color: rgb(0, 0, 0);
    border-left: 6px solid #ffeb3b;
    padding-left: 0.6rem;
    letter-spacing: 0.5px;
}

/* Butang kembali */
a.back-btn {
    display: inline-block;
    background: #ffeb3b;
    color: #1a237e;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
a.back-btn:hover {
    background: #fdd835;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 235, 59, 0.3);
}

/* Borang */
form {
    background: white;
    color: #1f2937;
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}
form:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    display: block;
    color: #374151;
}
select, input[type="number"], input[type="date"], input[type="file"] {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.55rem;
    font-size: 0.9rem;
    background: #f9fafb;
    transition: border-color 0.3s ease, background 0.3s ease;
}
select:focus, input:focus {
    border-color: #283593;
    background: white;
    outline: none;
    box-shadow: 0 0 0 2px rgba(40, 53, 147, 0.2);
}

/* Butang Submit */
button {
    background: linear-gradient(135deg, #d32f2f, #283593);
    color: white;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
button:hover {
    background: linear-gradient(135deg, #b71c1c, #1a237e);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(26, 35, 126, 0.3);
}

/* Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Jadual */
table {
    width: 100%;
    background: linear-gradient(90deg, #d32f2f 0%, #283593 50%, #1a237e 100%);
    color: white;
    border-collapse: collapse;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
}
thead {
    background: rgba(0,0,0,0.2);
    color: white;
}
th, td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
tbody tr {
    transition: background 0.2s ease;
}
tbody tr:hover {
    background: rgba(255,255,255,0.1);
}

/* Gambar */
td img {
    max-width: 80px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}
td img:hover {
    transform: scale(1.05);
}

/* Text center */
.text-center {
    text-align: center;
}

/* Butang Padam */
.btn-delete {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    padding: 0.35rem 0.7rem;
    border-radius: 5px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-delete:hover {
    background: linear-gradient(135deg, #b71c1c, #880e4f);
    box-shadow: 0 3px 8px rgba(211, 47, 47, 0.3);
}

/* Modal Gambar */
#imageModal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: fadeIn 0.3s ease;
}
#imageModal img {
    max-height: 90%;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
#imageModal span {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}
#imageModal span:hover {
    transform: rotate(90deg);
}

/* Animasi masuk */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}