@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Oswald:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #172554 100%);
    background-attachment: fixed;
    color: #e2e8f0;
    min-height: 100vh;
    padding: 40px 20px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body.login-bg {
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(23, 37, 84, 0.85)), url('binary-bg.png') center/cover fixed;
}

.container {
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
}

/* Glassmorphism Common Utility */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* Header & Controls */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 30px;
    border-radius: 20px;
}

.header h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #e2e8f0, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-add {
    background: linear-gradient(45deg, #1d4ed8, #3b82f6);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    filter: brightness(1.1);
}

/* Toolbar (Search & Total) */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin-bottom: 30px;
    border-radius: 16px;
    gap: 20px;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 8px 15px;
    flex-grow: 1;
    max-width: 400px;
    position: relative;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-icon {
    color: #94a3b8;
    margin-right: 10px;
}

.search-input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    font-size: 0.95rem;
    outline: none;
}

.search-input::placeholder {
    color: #64748b;
}

.btn-clear {
    color: #94a3b8;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0 5px;
    margin-left: 5px;
    transition: color 0.2s;
}

.btn-clear:hover {
    color: #ef4444;
}

.total-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.95rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.total-badge strong {
    color: #fff;
    font-size: 1.05rem;
    margin-left: 5px;
}

/* KTP Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    justify-items: center;
}

@media screen and (max-width: 1400px) {
    .grid-container { grid-template-columns: repeat(4, 1fr); }
}
@media screen and (max-width: 1100px) {
    .grid-container { grid-template-columns: repeat(3, 1fr); }
}
@media screen and (max-width: 850px) {
    .grid-container { grid-template-columns: repeat(2, 1fr); }
}

/* Modern KTP Card */
.ktp-card {
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
}

.ktp-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255,255,255,0.15);
}

/* The Image Area */
.ktp-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1.6;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

.ktp-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ktp-card:hover .ktp-image-wrapper img {
    transform: scale(1.05);
}

/* Image Overlay for smooth transition to bottom info */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, #213059, transparent);
    z-index: 1;
}

/* Download Icon (Floating Modern) */
.download-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 2;
}

.download-icon:hover {
    background: #3b82f6;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* Card Info Section (Name and Delete) */
.ktp-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background-color: #213059; /* Solid blue matching screenshot */
    border-top: none;
}

.ktp-name {
    font-family: 'Oswald', Impact, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #f8fafc;
    text-align: center;
    margin: 0;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s;
}

.ktp-name:hover {
    color: #94a3b8;
    transform: scale(1.02);
}

/* Floating Delete Icon (Top Left) */
.delete-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(239, 68, 68, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px; /* Kecil aja */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 2;
}

.delete-icon:hover {
    background: #ef4444;
    transform: scale(1.15) rotate(-5deg);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

/* General / Form Delete Button */
.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 30px 20px 20px;
    margin-top: 40px;
    color: #ffffff;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.app-footer p {
    margin: 0;
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Responsive Design (Mobile Friendly) */
@media screen and (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        text-align: center;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .search-form {
        max-width: 100%;
        width: 100%;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ktp-image-wrapper {
        aspect-ratio: 1.6;
    }

    .form-container {
        padding: 25px 20px;
    }
    
    .modal-box {
        padding: 20px;
        width: 95%;
    }
}

/* Form Container Modern */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 24px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Custom File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-wrapper:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #3b82f6;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-text {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-top: 10px;
    pointer-events: none;
    text-align: center;
    padding: 0 10px;
}

.file-upload-icon {
    color: #3b82f6;
    margin-bottom: 5px;
}

.btn-submit {
    background: linear-gradient(45deg, #10b981, #059669); /* Keep it green, but nice emerald */
    color: white;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    filter: brightness(1.1);
}

/* Back Button */
.btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateX(-3px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px;
    font-size: 1.2rem;
    color: #94a3b8;
    grid-column: 1 / -1;
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #1e293b;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-box h3 {
    margin-bottom: 15px;
    color: #f8fafc;
    font-size: 1.4rem;
}

.modal-box p {
    color: #94a3b8;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-confirm-delete {
    background: #ef4444;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-confirm-delete:hover {
    background: #dc2626;
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}


/* Cursor Trail */
.cursor-star {
    position: absolute;
    pointer-events: none;
    z-index: 99999;
    font-size: 16px;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
    text-shadow: 0 0 8px currentColor;
}



/* Premium Animations */
.animated-title {
    background: linear-gradient(90deg, #38bdf8, #818cf8, #34d399, #38bdf8);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-text 4s linear infinite;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}
@keyframes gradient-text {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.btn-icon-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
}
.btn-icon-premium.mass { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.btn-icon-premium.mass:hover { background: rgba(16, 185, 129, 0.8); color: white; box-shadow: 0 0 20px rgba(16, 185, 129, 0.6); transform: translateY(-3px) scale(1.1); }

.btn-icon-premium.add { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.4); color: #60a5fa; }
.btn-icon-premium.add:hover { background: rgba(59, 130, 246, 0.8); color: white; box-shadow: 0 0 20px rgba(59, 130, 246, 0.6); transform: translateY(-3px) scale(1.1); }

.btn-icon-premium.logout { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.btn-icon-premium.logout:hover { background: rgba(239, 68, 68, 0.8); color: white; box-shadow: 0 0 20px rgba(239, 68, 68, 0.6); transform: translateY(-3px) scale(1.1); }


.btn-icon-premium.back { background: rgba(148, 163, 184, 0.2); border-color: rgba(148, 163, 184, 0.4); color: #cbd5e1; }
.btn-icon-premium.back:hover { background: rgba(148, 163, 184, 0.8); color: white; box-shadow: 0 0 20px rgba(148, 163, 184, 0.6); transform: translateY(-3px) scale(1.1); }


.number-badge {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Category Filters */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 10px;
    border-radius: 50px;
    flex-wrap: wrap;
}
.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}
.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}
.filter-btn.active {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

/* Document Icon Wrapper */
.document-icon-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
}
.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.6);
    color: #f8fafc;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    appearance: auto;
}
.form-select option {
    background: #0f172a;
    color: #f8fafc;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px 20px;
    }
    .header h1 {
        font-size: 2.2rem;
        text-align: center;
    }
    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    .search-form {
        max-width: 100%;
    }
    .total-badge {
        align-self: center;
    }
}
