/* Global styles for SaaS App */

/* Ensure full height usage - CRITICAL */
html, body {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#app {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Remove all default margins and paddings */
* {
    box-sizing: border-box;
}

body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Sticky table headers */
.table thead.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Improve table responsiveness */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Full height pages */
.page-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Scrollable content areas */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Card improvements for detail pages */
.detail-card {
    max-width: 800px;
    margin: 0 auto;
}

/* Responsive form layouts */
@media (max-width: 768px) {
    .row.mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .col-sm-3, .col-sm-9 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .form-label {
        margin-bottom: 0.25rem;
    }
}

/* Better spacing for buttons */
.btn-group-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Improve modal on small screens */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

button, a, input, select {
    transition: all 0.2s ease;
}

/* Loading states */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Alert improvements */
.alert {
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Table hover effects */
.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    cursor: pointer;
}

/* Badge improvements */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* Field Label with Help Icon */
.field-help-icon {
    font-size: 0.85rem;
    cursor: help;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.field-help-icon:hover {
    opacity: 1;
    color: #0d6efd !important;
}

/* Bootstrap tooltip override for better styling */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    text-align: left;
    background-color: #2c3e50;
    border-radius: 0.375rem;
}

.tooltip .tooltip-arrow::before {
    border-top-color: #2c3e50;
    border-bottom-color: #2c3e50;
}
