/* ============================================
   CUSTOM STYLES UNTUK JO EXECUTIVE BANDUNG
   ============================================ */

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
    background: #334155;
    border: 2px solid #475569;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast-success {
    border-color: #10b981;
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

.toast-error {
    border-color: #ef4444;
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

.toast-warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
}

.toast-info {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    line-height: 1.5;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.toast-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Pull to Refresh Styles */
.pull-to-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Infinite Scroll Loader */
.infinite-scroll-loader {
    min-height: 100px;
}

/* Date Picker Enhanced */
.date-picker-calendar {
    min-width: 300px;
}

.calendar-days .date-day:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Onboarding Tour */
.onboarding-overlay {
    pointer-events: auto;
}

.onboarding-tooltip {
    animation: fadeInTooltip 0.3s ease-out;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* File Upload Drag & Drop */
.file-upload-wrapper .dropzone-content {
    transition: all 0.3s ease;
}

#{{ $uploadId }}-dropzone.dragover .dropzone-content {
    transform: scale(1.02);
}

/* Tooltip Styles */
.tooltip-content {
    animation: fadeInTooltip 0.2s ease-out;
    pointer-events: none;
    z-index: 9999;
}

/* Password Strength Indicator */
.password-strength {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .toast {
        min-width: auto;
        max-width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    
    .onboarding-tooltip {
        max-width: calc(100% - 40px);
        left: 20px !important;
        right: 20px !important;
    }
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: 'kern' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styling - Enhanced */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #475569 0%, #64748b 100%);
    border-radius: 6px;
    border: 2px solid #1e293b;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b 0%, #94a3b8 100%);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e293b;
}

/* Selection - Enhanced */
::selection {
    background: rgba(200, 16, 46, 0.3);
    color: #f1f5f9;
}

::-moz-selection {
    background: rgba(200, 16, 46, 0.3);
    color: #f1f5f9;
}

/* Input Focus - Enhanced */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
    transition: all 0.3s ease;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #C8102E;
    outline-offset: 2px;
}

/* Form Elements - Enhanced */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
textarea,
select {
    transition: all 0.3s ease;
}

input:disabled,
textarea:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Checkbox & Radio - Enhanced */
input[type="checkbox"],
input[type="radio"] {
    accent-color: #C8102E;
    cursor: pointer;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: #C8102E;
    border-color: #C8102E;
}

/* Pagination Styles - Enhanced */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.625rem 1.25rem;
    background: #334155;
    border: 2px solid #475569;
    border-radius: 0.75rem;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    min-width: 2.5rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination a:hover {
    background: #475569;
    border-color: #C8102E;
    color: #C8102E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.2);
}

.pagination .active span {
    background: linear-gradient(135deg, #C8102E 0%, #001F3F 100%);
    border-color: #C8102E;
    color: white;
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

.pagination .disabled span,
.pagination .disabled a {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Line Clamp Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Button Utilities */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #C8102E 0%, #a00e25 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a00e25 0%, #C8102E 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.4);
}

.btn-secondary {
    background: #334155;
    color: #f1f5f9;
    border: 2px solid #475569;
}

.btn-secondary:hover {
    background: #475569;
    border-color: #C8102E;
    color: #C8102E;
}

.btn-outline {
    background: transparent;
    color: #C8102E;
    border: 2px solid #C8102E;
}

.btn-outline:hover {
    background: #C8102E;
    color: white;
}

/* Card Utilities */
.card {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border: 2px solid #475569;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #C8102E;
    box-shadow: 0 10px 30px rgba(200, 16, 46, 0.2);
    transform: translateY(-4px);
}

.card-header {
    border-bottom: 2px solid #475569;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 2px solid #475569;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Table Utilities */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background: linear-gradient(135deg, #001F3F 0%, #334155 100%);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: white;
    border-bottom: 2px solid #475569;
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #475569;
    color: #cbd5e1;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(200, 16, 46, 0.1);
    transform: scale(1.01);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive Table Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.75rem;
    border: 2px solid #475569;
}

.table-responsive table {
    margin: 0;
}

/* Mobile Table - Card Layout */
@media (max-width: 768px) {
    .table-responsive {
        display: block;
    }
    
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }
    
    .table-responsive thead {
        display: none;
    }
    
    .table-responsive tr {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
        border: 2px solid #475569;
        border-radius: 0.75rem;
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .table-responsive td {
        border: none;
        padding: 0.5rem 0;
        text-align: right;
        position: relative;
        padding-left: 50%;
    }
    
    .table-responsive td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 700;
        color: #f1f5f9;
        text-align: left;
    }
}

/* Badge Utilities */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Alert Utilities */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 2px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-warning {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
    color: #eab308;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(200, 16, 46, 0.1);
    border-top-color: #C8102E;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton Card */
.skeleton-card {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border: 2px solid #475569;
    border-radius: 1rem;
    padding: 1.5rem;
    overflow: hidden;
}

.skeleton-line {
    height: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-line.long {
    width: 100%;
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    margin-bottom: 1rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 70%;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    margin-bottom: 0.5rem;
}

.skeleton-button {
    height: 2.5rem;
    width: 8rem;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    margin-top: 1rem;
}

/* Smooth Transitions */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Accessibility - Focus Visible - Improved */
*:focus-visible {
    outline: 2px solid #C8102E;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Improved focus states for interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #C8102E;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.2);
}

/* Better color contrast for secondary text */
.text-dark-text-secondary {
    color: #cbd5e1; /* Improved from #94a3b8 for better contrast */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Lazy Loading Images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

img[loading="lazy"] {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

img[loading="lazy"].loaded {
    background: none;
    animation: none;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.breadcrumbs a {
    color: #cbd5e1;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs a:hover {
    color: #C8102E;
}

.breadcrumbs .separator {
    color: #64748b;
    margin: 0 0.25rem;
}

.breadcrumbs .current {
    color: #f1f5f9;
    font-weight: 600;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border: 2px solid;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

.toast-success::before {
    background: #22c55e;
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.toast-error::before {
    background: #ef4444;
}

.toast-warning {
    border-color: rgba(234, 179, 8, 0.5);
    color: #eab308;
}

.toast-warning::before {
    background: #eab308;
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.5);
    color: #3b82f6;
}

.toast-info::before {
    background: #3b82f6;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: #f1f5f9;
}

.toast-message {
    font-size: 0.8125rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    width: 100%;
    transform-origin: left;
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Mobile Toast - Improved stacking */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        gap: 8px;
    }
    
    .toast {
        transform: translateY(-100px);
        margin-bottom: 0;
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .toast.hide {
        transform: translateY(-100px);
    }
    
    /* Stack toasts vertically on mobile */
    .toast-container {
        flex-direction: column-reverse;
    }
}

/* Toast stacking - Better spacing between toasts */
.toast-container .toast {
    margin-bottom: 12px;
}

.toast-container .toast:last-child {
    margin-bottom: 0;
}

/* Mobile Experience Improvements - Enhanced */
@media (max-width: 768px) {
    /* Ensure minimum touch target size (44x44px) */
    button, a, input[type="submit"], input[type="button"], .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Responsive Tables - Improved */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    /* Ensure data-label is visible on mobile */
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #f1f5f9;
        text-align: left;
    }
    
    /* Card improvements for mobile */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Form improvements */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }
    
    /* Better button spacing */
    .flex.gap-3 > * {
        min-width: 44px;
    }
    
    /* Better spacing between sections */
    section {
        padding: 2rem 0 !important;
    }
    
    /* Reduce padding on cards */
    .bg-dark-card, .bg-gradient-to-br {
        padding: 1rem !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    a, button {
        padding: 0.75rem 1rem;
    }
    
    /* Remove hover effects on touch devices */
    .hover\:scale-105:hover {
        transform: none;
    }
    
    /* Better focus states for touch */
    *:focus-visible {
        outline: 3px solid #C8102E;
        outline-offset: 2px;
    }
}

