/**
 * ABPAY Custom Styles
 * Clean & organized custom CSS for ABPAY application
 */

/* ==========================================================================
   APP LOADER — Modern Full-Screen Loader (replaces jQuery BlockUI)
   ========================================================================== */

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease;
}

.app-loader-content {
    background: #fff;
    border-radius: 12px;
    padding: 32px 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    min-width: 200px;
    max-width: 90vw;
}

.app-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #696cff;
    border-radius: 50%;
    animation: app-loader-spin 0.7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes app-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

.app-loader-text {
    margin: 0;
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.app-loader-subtext {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}

/* Dark mode support */
.dark-style .app-loader {
    background: rgba(0, 0, 0, 0.55);
}

.dark-style .app-loader-content {
    background: #2f3349;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dark-style .app-loader-text {
    color: #e0e0e0;
}

.dark-style .app-loader-subtext {
    color: #7a7a9a;
}

.dark-style .app-loader-spinner {
    border-color: #3a3b5c;
    border-top-color: #696cff;
}

/* ==========================================================================
   APP TOAST — Quick notifications without SweetAlert
   ========================================================================== */

.app-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.app-toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-toast.app-toast-show {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.app-toast-hiding {
    opacity: 0;
    transform: translateY(-10px);
}

.app-toast-success {
    background: #28a745;
}

.app-toast-error {
    background: #dc3545;
}

.app-toast-warning {
    background: #ff9f43;
}

.app-toast-info {
    background: #0dcaf0;
    color: #000;
}

.app-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ==========================================================================
   LOADER STYLES (Legacy)
   ========================================================================== */

.loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Text utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Spacing utilities */
.p-15 {
    padding: 15px !important;
}

.m-15 {
    margin: 15px !important;
}

.mb-15 {
    margin-bottom: 15px !important;
}

.mt-15 {
    margin-top: 15px !important;
}

/* ==========================================================================
   FORM ENHANCEMENTS
   ========================================================================== */

/* Form validation styling */
.is-invalid {
    border-color: #ff3e1d !important;
}

.invalid-feedback {
    color: #ff3e1d;
    font-size: 0.875rem;
}

/* ==========================================================================
   TABLE ENHANCEMENTS
   ========================================================================== */

/* Responsive table wrapper */
.table-responsive-stack {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table actions */
.table-actions {
    white-space: nowrap;
    width: 1%;
}

.table-actions .btn {
    margin-right: 4px;
}

.table-actions .btn:last-child {
    margin-right: 0;
}

/* ==========================================================================
   CARD ENHANCEMENTS
   ========================================================================== */

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */

@media (max-width: 768px) {

    .table-responsive-stack table,
    .table-responsive-stack thead,
    .table-responsive-stack tbody,
    .table-responsive-stack th,
    .table-responsive-stack td,
    .table-responsive-stack tr {
        display: block;
    }

    .table-responsive-stack thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive-stack tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 4px;
    }

    .table-responsive-stack td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        text-align: left !important;
    }

    .table-responsive-stack td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        text-align: left;
        font-weight: bold;
        color: #666;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .no-print {
        display: none !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    .btn {
        display: none !important;
    }
}