/* Shared UI Components */

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}
.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}
.card-header {
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 1.25rem;
}
.card-header h5, .card-header .h5 {
    font-weight: 600;
    margin: 0;
}
.card-body {
    padding: 1.25rem;
}

/* Form Styles */
.form-label {
    font-weight: 500;
    color: #344767;
    margin-bottom: 0.5rem;
}
.form-control {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}
.form-control:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 0.2rem rgba(0,86,179,0.15);
}
.input-group {
    border-radius: 8px;
}
.input-group-text {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn i {
    font-size: 1rem;
    flex-shrink: 0;
}

.btn-primary {
    background: #0056b3;
    border: none;
    box-shadow: 0 4px 6px rgba(0,86,179,0.12);
    color: white;
}

.btn-primary:hover, .btn-primary:focus {
    background: #004494;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0,86,179,0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,86,179,0.1);
}

.btn-secondary {
    background: #6c757d;
    border: none;
    box-shadow: 0 4px 6px rgba(108,117,125,0.12);
    color: white;
}

.btn-secondary:hover, .btn-secondary:focus {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid #0056b3;
    color: #0056b3;
    background: transparent;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: #0056b3;
    color: white;
    transform: translateY(-1px);
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Mobile Button Optimizations */
@media (max-width: 768px) {
    .btn {
        padding: 0.875rem 1.25rem;
        width: 100%;
        margin-bottom: 0.5rem;
        height: auto;
        min-height: 48px; /* Minimum touch target size */
    }

    /* Keep buttons in groups side by side */
    .btn-group .btn,
    .btn-group-sm .btn,
    .d-flex .btn,
    .d-inline-flex .btn {
        width: auto;
        margin-bottom: 0;
    }

    /* Action buttons (like submit) at the bottom */
    .form-actions .btn,
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Fixed action buttons */
    .fixed-bottom .btn,
    .sticky-bottom .btn {
        border-radius: 0;
        margin-bottom: 0;
        height: 56px;
    }

    /* Back buttons */
    .btn-back {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

    .btn-icon i {
        font-size: 1.25rem;
    }

    /* Loading state */
    .btn.loading {
        opacity: 0.8;
        pointer-events: none;
    }

    .btn.loading::after {
        content: '';
        width: 1rem;
        height: 1rem;
        border: 2px solid rgba(255,255,255,0.3);
        border-radius: 50%;
        border-top-color: white;
        animation: spin 1s infinite linear;
        margin-left: 0.5rem;
    }

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

/* Table Styles */
.table {
    margin-bottom: 0;
}
.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    color: #344767;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.table td {
    vertical-align: middle;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}
.table-hover tbody tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 6px;
}
.badge-primary {
    background: rgba(0,86,179,0.1);
    color: #0056b3;
}
.badge-success {
    background: rgba(40,167,69,0.1);
    color: #28a745;
}
.badge-warning {
    background: rgba(255,193,7,0.1);
    color: #ffc107;
}
.badge-danger {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
.alert-success {
    background: rgba(40,167,69,0.1);
    color: #28a745;
}
.alert-danger {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}
.alert-warning {
    background: rgba(255,193,7,0.1);
    color: #ffc107;
}
.alert-info {
    background: rgba(0,86,179,0.1);
    color: #0056b3;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem !important;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        border-radius: 12px;
        margin: 0;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        width: auto;
        margin-bottom: 0;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .alert {
        margin-bottom: 1rem;
    }
}

/* Utility Classes */
.text-muted {
    color: #6c757d !important;
}
.font-weight-bold {
    font-weight: 600 !important;
}
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}
.shadow {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
}
.shadow-lg {
    box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
}
.rounded-lg {
    border-radius: 12px !important;
}
