/* === Container Upload Card === */
.upload-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.upload-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}
.upload-card h5 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}
.upload-placeholder {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 30px 10px;
    cursor: pointer;
    position: relative;
    transition: 0.3s;
}
.upload-placeholder:hover {
    border-color: #007bff;
    background: rgba(0,123,255,0.03);
}
.upload-placeholder i {
    font-size: 40px;
    color: #007bff;
    margin-bottom: 8px;
}
.upload-placeholder p {
    margin: 0;
    color: #777;
    font-size: 14px;
}

.preview-img {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 4 / 3; /* proporsional (bisa ubah ke 1/1 untuk square) */
    margin-top: 15px;
    display: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    object-fit: cover; /* jaga proporsi, isi penuh */
    object-position: center;
    background-color: #f8f9fa; /* background netral saat belum ada foto */
    transition: all 0.3s ease-in-out;
}
.preview-img.active {
    display: block;
    transform: scale(1.02);
}


/* === Camera Button === */
.btn-camera {
    background: linear-gradient(135deg, #007bff, #00b4d8);
    color: #fff;
    border: none;
    padding: 8px 15px;
    margin-top: 12px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}
.btn-camera:hover {
    background: linear-gradient(135deg, #0056b3, #0096c7);
    transform: scale(1.03);
}
.btn-camera i {
    font-size: 16px;
}

/* === Modal Overlay === */
#cameraModal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(4px);
    padding: 0;
    margin: 0;
    z-index: 9999;
    box-sizing: border-box;
}

.camera-wrapper {
    position: relative;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 420px;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
}

/* === Video Stream === */
#cameraModal video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === Tombol Aksi Kamera === */
.camera-actions {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    justify-content: center;
}

.camera-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.camera-actions .capture {
    background: linear-gradient(145deg, #28a745, #1e7e34);
    color: #fff;
}
.camera-actions .switch {
    background: linear-gradient(145deg, #ffc107, #d39e00);
    color: #000;
}
.camera-actions .close {
    background: linear-gradient(145deg, #dc3545, #a71d2a);
    color: #fff;
}

.camera-actions button:hover {
    transform: scale(1.1);
}

/* === Responsiveness === */
@media (max-width: 768px) {
    .camera-wrapper {
        max-width: 90%;
        aspect-ratio: 3 / 4;
    }
    .camera-actions button {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .camera-wrapper {
        max-width: 95%;
        border-radius: 12px;
    }
    .camera-actions button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}