/**
 * Licenses Module Styles
 *
 * Modern, responsive CSS for license management module
 *
 * @package payEfb
 * @since 2.0.0
 */

/* ===== Module Container ===== */
.licenses-module {
    padding: 0;
}

/* ===== Stats Cards ===== */
#licenses-stats .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#licenses-stats .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

#licenses-stats .bg-gradient {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark, #3730a3) 100%);
}

#licenses-stats .bg-success.bg-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

#licenses-stats .bg-warning.bg-gradient {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

#licenses-stats .bg-info.bg-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* ===== Licenses List Table ===== */
.licenses-module .table {
    margin-bottom: 0;
}

.licenses-module .table thead th {
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding: 1rem 0.75rem;
}

.licenses-module .table tbody tr {
    transition: background-color 0.2s ease;
}

.licenses-module .table tbody tr:hover {
    background-color: #f9fafb;
}

.licenses-module .table tbody td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

/* ===== Badges ===== */
.licenses-module .badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.licenses-module .badge i {
    font-size: 0.7rem;
}

/* ===== Action Buttons ===== */
.licenses-module .btn-group-sm .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.licenses-module .btn-group-sm .btn i {
    font-size: 0.875rem;
}

.licenses-module .btn-group-sm .btn:not(:last-child) {
    border-right: 0;
}

/* ===== Copy Code Button ===== */
.copy-code-btn {
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background-color: #f3f4f6;
}

.copy-code-btn:active {
    transform: scale(0.95);
}

/* ===== Add License Modal ===== */
#addLicenseModal .modal-dialog {
    max-width: 800px;
}

#addLicenseModal .modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    border-bottom: 0;
}

#addLicenseModal .modal-header .btn-close {
    filter: invert(1);
}

/* ===== Package Cards ===== */
.package-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.package-card:hover {
    transform: translateY(-5px);
}

.package-card .card {
    transition: all 0.3s ease;
    border-width: 2px;
}

.package-card .card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.package-card .card.border-primary {
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}

.package-card ul {
    text-align: left;
}

.package-card ul li {
    font-size: 0.875rem;
}

.package-card .badge {
    position: absolute;
    top: -10px;
    right: 20px;
}

/* ===== Loading States ===== */
#licenses-loading {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#licenses-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===== Empty State ===== */
#licenses-empty {
    min-height: 300px;
}

#licenses-empty .bi-inbox {
    font-size: 4rem;
    opacity: 0.3;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    /* Stack stats cards on mobile */
    #licenses-stats .col-md-3 {
        margin-bottom: 1rem;
    }

    /* Make table scrollable */
    .licenses-module .table-responsive {
        overflow-x: auto;
    }

    /* Adjust modal */
    #addLicenseModal .modal-dialog {
        margin: 0.5rem;
    }

    /* Stack package cards */
    .package-card {
        margin-bottom: 1rem;
    }

    /* Smaller action buttons */
    .licenses-module .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ===== License Details Modal ===== */
#licenseDetailsModal .modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    border-bottom: 0;
}

#licenseDetailsModal .modal-header .btn-close {
    filter: invert(1);
}

#licenseDetailsModal .form-label {
    margin-bottom: 0.5rem;
}

#licenseDetailsModal .input-group .form-control {
    font-size: 0.875rem;
    background-color: #f9fafb;
}

/* ===== Cursor Helpers ===== */
.cursor-pointer {
    cursor: pointer;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.licenses-module .table tbody tr {
    animation: fadeIn 0.3s ease;
}

#licenses-stats .card {
    animation: fadeIn 0.5s ease;
}

#licenses-stats .col-md-3:nth-child(1) .card {
    animation-delay: 0.1s;
}

#licenses-stats .col-md-3:nth-child(2) .card {
    animation-delay: 0.2s;
}

#licenses-stats .col-md-3:nth-child(3) .card {
    animation-delay: 0.3s;
}

#licenses-stats .col-md-3:nth-child(4) .card {
    animation-delay: 0.4s;
}

/* ===== Utility Classes ===== */
.font-monospace {
    font-family: 'Courier New', Courier, monospace;
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* ===== Print Styles ===== */
@media print {
    .licenses-module .btn,
    .licenses-module .btn-group,
    #add-license-btn {
        display: none !important;
    }

    .licenses-module .table {
        border: 1px solid #dee2e6;
    }
}

/* ===== Dark Mode Support (Optional) ===== */
@media (prefers-color-scheme: dark) {
    .licenses-module .table tbody tr:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .licenses-module .table thead th {
        color: #9ca3af;
    }

    #licenses-empty .bi-inbox {
        opacity: 0.2;
    }
}

/* ===== Alert Customizations ===== */
#premium-notice {
    border-left: 4px solid #3b82f6;
    background-color: #eff6ff;
    border-color: #3b82f6;
}

/* ===== Form Controls ===== */
.licenses-module .form-control:focus,
.licenses-module .form-select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}

/* ===== Bootstrap Icons Adjustments ===== */
.bi {
    vertical-align: -.125em;
}

/* ===== Modal Backdrop ===== */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

/* ===== Success/Error States ===== */
.licenses-module .is-invalid {
    border-color: #dc3545;
}

.licenses-module .is-valid {
    border-color: #10b981;
}

/* ===== Loading Spinner ===== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}
