/* ============================================
   DigiActive - Custom Styles
   ============================================ */

/* Import Google Fonts (fallback jika CDN tidak jalan) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ============================================
   Reset & Base
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    min-height: 100vh;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ============================================
   Utility Classes
   ============================================ */
/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Card Hover */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.08);
}

/* Sidebar Link */
.sidebar-link {
    transition: all 0.15s ease;
    border-radius: 12px;
    cursor: pointer;
}

.sidebar-link:hover {
    background: #eef2ff;
}

.sidebar-link.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.sidebar-link i {
    width: 24px;
    text-align: center;
}

/* ============================================
   Table Styles
   ============================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.table-container thead th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table-container tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-container tbody tr:hover {
    background: #f8fafc;
}

.table-container tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Form Styles
   ============================================ */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #ffffff;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* ============================================
   Badge / Status
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: capitalize;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

.badge-online {
    background: #d1fae5;
    color: #065f46;
}

.badge-online::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 4px;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ============================================
   Modal
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
    display: none;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 28rem;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-backdrop:not(.hidden) .modal-content {
    transform: scale(1);
}

/* ============================================
   Toast Notification
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.2);
    font-size: 0.875rem;
    font-weight: 600;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: #065f46;
    color: #d1fae5;
}

.toast-error {
    background: #991b1b;
    color: #fee2e2;
}

/* ============================================
   Copy Button Animation
   ============================================ */
.copy-btn {
    transition: all 0.2s ease;
}

.copy-btn.copied {
    background: #d1fae5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

.copy-btn.copied i {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* ============================================
   Responsive Tweaks
   ============================================ */
@media (max-width: 640px) {
    .table-container table {
        font-size: 0.75rem;
    }
    
    .table-container thead th,
    .table-container tbody td {
        padding: 0.5rem 0.625rem;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: white;
    }
    .table-container {
        overflow: visible;
    }
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Script / Code Block
   ============================================ */
.code-block {
    background: #0f172a;
    color: #34d399;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #1e293b;
}

/* ============================================
   Miscellaneous
   ============================================ */
.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.select-all {
    user-select: all;
    -webkit-user-select: all;
}

/* Hover efek untuk tombol aksi di tabel */
.action-btn {
    transition: all 0.15s ease;
}

.action-btn:hover {
    transform: scale(1.05);
}

/* Gradient untuk header */
.gradient-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}