/**
 * Global UI/UX Standardization CSS
 * MyIKMAS Backend - 2025
 * 
 * This file defines the global UI standards for all backend modules.
 * All buttons, icons, layouts, and components should follow these rules.
 */

/* ========================================
   1. BUTTON STANDARDIZATION
   ======================================== */

/* Force all .btn elements to be rounded-pill by default in backend */
.btn {
    border-radius: 50rem !important;
}

/* Button Size Standards */
.btn-action {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Action Toolbar Buttons */
.action-toolbar .btn {
    margin-left: 0.5rem;
}

.action-toolbar .btn:first-child {
    margin-left: 0;
}

/* Table Action Button Group */
.table-action-group {
    display: inline-flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.table-action-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Icon-only buttons in tables */
.btn-icon-only {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   2. PAGE HEADER STANDARDIZATION
   ======================================== */

.page-header-standard {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-standard .page-title-area {
    flex: 1;
}

.page-header-standard .page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.page-header-standard .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.page-header-standard .action-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ========================================
   3. CARD STANDARDIZATION
   ======================================== */

.card-standard {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-standard .card-body {
    padding: 0;
}

.card-standard .card-body-padded {
    padding: 1.5rem;
}

/* ========================================
   4. TABLE STANDARDIZATION
   ======================================== */

.table-standard {
    margin-bottom: 0;
}

.table-standard thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    color: #495057;
    padding: 0.75rem 1rem;
}

.table-standard tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table-standard tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.04);
}

/* Action Column */
.table-standard .action-column {
    width: 180px;
    text-align: center;
    white-space: nowrap;
}

/* ========================================
   5. FORM STANDARDIZATION
   ======================================== */

.form-standard .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-standard .form-control,
.form-standard .form-select {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
}

.form-standard .form-control:focus,
.form-standard .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-standard .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Required Field Indicator */
.form-standard .required .form-label::after {
    content: " *";
    color: #dc3545;
}

/* ========================================
   6. MODAL STANDARDIZATION
   ======================================== */

.modal-header {
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd) 0%, rgba(var(--bs-primary-rgb, 13, 110, 253), 0.8) 100%);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-standard .modal-header {
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd) 0%, rgba(var(--bs-primary-rgb, 13, 110, 253), 0.8) 100%);
    color: white;
    border-bottom: none;
}

.modal-standard .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-standard .modal-header .btn-close:hover {
    opacity: 1;
}

.modal-standard .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 1rem 1.5rem;
}

/* ========================================
   7. PAGINATION STANDARDIZATION
   ======================================== */

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.pagination-wrapper .summary {
    font-size: 0.875rem;
    color: #6c757d;
}

/* ========================================
   8. STATUS BADGES
   ======================================== */

.badge-status {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 50rem;
}

.badge-active {
    background-color: #d4edda;
    color: #155724;
}

.badge-inactive {
    background-color: #e2e3e5;
    color: #6c757d;
}

.badge-deleted {
    background-color: #f8d7da;
    color: #721c24;
}

/* ========================================
   9. TOOLTIP ENHANCEMENTS
   ======================================== */

.tooltip-inner {
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

/* ========================================
   10. TREE VIEW (Menu Management)
   ======================================== */

.tree-actions {
    display: inline-flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-item:hover .tree-actions {
    opacity: 1;
}

.tree-item-content:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* ========================================
   11. ANIMATION UTILITIES
   ======================================== */

.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* ========================================
   12. RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .page-header-standard {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-standard .action-toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .table-action-group {
        flex-wrap: wrap;
    }
}