/* Container Utama */
.so-container {
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.so-container h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Grid untuk Daftar Surat */
.so-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Kartu Jenis Surat */
.so-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eaeaea;
}

.so-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.so-card h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #34495e;
}

/* Tombol */
.so-btn-pilih, .so-btn-submit {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    width: 100%;
}

.so-btn-pilih:hover, .so-btn-submit:hover {
    background-color: #2980b9;
}

.so-btn-back {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 0;
}

.so-btn-back:hover {
    color: #2c3e50;
    text-decoration: underline;
}

/* Form Input */
.so-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.so-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.so-form-group input[type="text"],
.so-form-group input[type="number"],
.so-form-group input[type="file"],
.so-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
    background: #fff;
}

.so-form-group input:focus,
.so-form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.so-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.so-btn-submit {
    margin-top: 10px;
    padding: 14px;
    font-size: 16px;
}

/* Pesan Notifikasi */
#so-message {
    margin-top: 20px;
    text-align: center;
}

.so-success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #c3e6cb;
}

.so-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
}

/* --- Perbaikan Kartu Jenis Surat dengan Background Gambar --- */

.so-card {
    position: relative;
    background-image: url('https://desatanjungdedai.com/wp-content/uploads/2026/10/gambar-surat.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px; /* Sudut lebih melengkung */
    padding: 0; /* Hapus padding default agar overlay full */
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    border: none;
    overflow: hidden; /* Agar efek zoom tidak keluar kotak */
    min-height: 220px; /* Tinggi minimum agar gambar proporsional */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Teks dan tombol di bawah */
}

/* Overlay Gelap agar Teks Terbaca */
.so-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
    transition: background 0.3s ease;
}

/* Efek Hover: Zoom Gambar & Overlay Lebih Gelap */
.so-card:hover {
    transform: translateY(-8px); /* Efek melayang lebih tinggi */
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.so-card:hover::before {
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.9) 100%);
}

/* Konten di Dalam Kartu (Judul & Tombol) */
.so-card h3 {
    position: relative;
    z-index: 2; /* Di atas overlay */
    color: #ffffff; /* Teks putih */
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 15px 0;
    padding: 0 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Bayangan teks */
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* Tombol di Dalam Kartu */
.so-btn-pilih {
    position: relative;
    z-index: 2; /* Di atas overlay */
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 80%; /* Tombol tidak full width agar lebih elegan */
    margin: 0 auto 20px auto; /* Center tombol dan beri jarak bawah */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.so-btn-pilih:hover {
    background-color: #2980b9;
    transform: scale(1.05); /* Sedikit membesar saat hover */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Responsif untuk Layar Kecil */
@media (max-width: 768px) {
    .so-card {
        min-height: 200px;
    }
    .so-card h3 {
        font-size: 18px;
    }
    .so-btn-pilih {
        width: 90%;
    }
}
/* --- IKON DI ATAS JUDUL --- */
.so-card-icon {
    position: relative;
    z-index: 2;
    font-size: 48px;
    line-height: 1;
    margin-bottom: 10px;
    padding-top: 20px;
    text-align: center;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
    transition: transform 0.3s ease;
}

.so-card:hover .so-card-icon {
    transform: scale(1.15) translateY(-3px);
}

/* Jika pakai Font Awesome (opsional) */
.so-card-icon i {
    font-size: 48px;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* Sesuaikan tinggi kartu karena ada ikon */
.so-card {
    min-height: 280px; /* Naikkan dari 220px */
    justify-content: flex-end;
    padding-bottom: 0;
}

/* --- EFEK FADE-IN SAAT HALAMAN DIBUKA --- */

/* 1. Fade-in untuk container utama */
.so-container {
    animation: soFadeIn 0.6s ease-out both;
}

/* 2. Fade-in bertahap untuk setiap kartu */
.so-card {
    opacity: 0;
    transform: translateY(30px);
    animation: soCardFadeIn 0.6s ease-out forwards;
}

/* Delay bertahap agar muncul satu per satu */
.so-card:nth-child(1) { animation-delay: 0.1s; }
.so-card:nth-child(2) { animation-delay: 0.2s; }
.so-card:nth-child(3) { animation-delay: 0.3s; }
.so-card:nth-child(4) { animation-delay: 0.4s; }
.so-card:nth-child(5) { animation-delay: 0.5s; }
.so-card:nth-child(6) { animation-delay: 0.6s; }
.so-card:nth-child(7) { animation-delay: 0.7s; }
.so-card:nth-child(8) { animation-delay: 0.8s; }
.so-card:nth-child(9) { animation-delay: 0.9s; }
.so-card:nth-child(10) { animation-delay: 1.0s; }

/* Judul "Pilih Jenis Surat" fade-in dari atas */
.so-container h2 {
    animation: soTitleFadeIn 0.8s ease-out both;
}

/* --- KEYFRAMES --- */
@keyframes soFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes soCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes soTitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- TOMBOL AGAR TIDAK KETUTUPAN IKON --- */
.so-btn-pilih {
    margin-bottom: 20px;
}

/* Responsif */
@media (max-width: 768px) {
    .so-card {
        min-height: 240px;
    }
    .so-card-icon {
        font-size: 38px;
    }
}