/* 
 * custom-styles.css
 * Additional component and layout styles
 * Complements theme.css
 */

/* ========================================
   CONTAINER ADJUSTMENTS
   ======================================== */

.container-fluid {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

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

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* ========================================
   DISPLAY UTILITIES
   ======================================== */

.d-none { display: none; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* ========================================
   SECTION STYLING
   ======================================== */

section {
    padding: var(--spacing-xl) 0;
}

section + section {
    border-top: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.section-header h2 {
    margin-bottom: var(--spacing-md);
}

.section-header p {
    font-size: 16px;
    color: var(--text-gray);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

@media (max-width: 1199px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   DROPDOWN MENU STYLING
   ======================================== */

.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: 0.255em;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    position: absolute;
    top: 100%;

    z-index: 1000;
    display: none;
    float: left;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: var(--text-white);
    text-align: left;
    list-style: none;
    background-color: var(--primary-darker);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
}

.dropdown-menu.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 400;
    color: var(--text-gray);
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--accent-cyan);
    background-color: rgba(43, 75, 160, 0.2);
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   MODAL / DIALOG STYLING
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--accent-cyan);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ========================================
   PROGRESS BAR
   ======================================== */

.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm) inset;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: var(--primary-dark);
    text-align: center;
    white-space: nowrap;
    background-color: var(--accent-cyan);
    transition: width 0.6s ease;
}

.progress-bar-success {
    background-color: var(--success-color);
}

.progress-bar-warning {
    background-color: var(--warning-color);
}

.progress-bar-danger {
    background-color: var(--error-color);
}

.progress-bar-info {
    background-color: var(--info-color);
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: var(--border-radius-md);
    gap: var(--spacing-sm);
}

.page-link {
    position: relative;
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-left: -1px;
    line-height: 1.25;
    color: var(--accent-cyan);
    background-color: transparent;
    border: 1px solid var(--border-color);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: var(--border-radius-md);
}

.page-link:hover {
    z-index: 2;
    color: var(--accent-cyan-hover);
    background-color: rgba(43, 75, 160, 0.1);
    border-color: var(--accent-cyan);
}

.page-link.active {
    z-index: 3;
    color: var(--primary-dark);
    background-color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.page-link.disabled {
    color: var(--text-gray-dark);
    pointer-events: none;
    cursor: auto;
    background-color: transparent;
    border-color: var(--border-color);
    opacity: 0.5;
}

/* ========================================
   BREADCRUMB
   ======================================== */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--text-gray);
}

.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding: 0 var(--spacing-sm);
    content: '/';
    color: var(--text-gray-dark);
}

.breadcrumb-item a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent-cyan-hover);
}

.breadcrumb-item.active {
    color: var(--text-white);
}

/* ========================================
   LIST GROUPS
   ======================================== */

.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.list-group-item {
    position: relative;
    display: block;
    padding: var(--spacing-md);
    color: var(--text-gray);
    background-color: rgba(43, 75, 160, 0.05);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.list-group-item:first-child {
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
    border-bottom: 1px solid var(--border-color);
}

.list-group-item:hover {
    color: var(--text-white);
    background-color: rgba(43, 75, 160, 0.15);
    border-color: var(--accent-cyan);
    cursor: pointer;
}

.list-group-item.active {
    color: var(--primary-dark);
    background-color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* ========================================
   STACK / FLEX UTILITIES
   ======================================== */

.stack {
    display: flex;
    flex-direction: column;
}

.hstack {
    display: flex;
    flex-direction: row;
}

.vstack > * + * {
    margin-top: var(--spacing-md);
}

.hstack > * + * {
    margin-left: var(--spacing-md);
}

/* ========================================
   VISIBILITY UTILITIES
   ======================================== */

.visible {
    visibility: visible !important;
}

.invisible {
    visibility: hidden !important;
}

.hidden-xs {
    display: none !important;
}

@media (min-width: 576px) {
    .hidden-xs {
        display: block !important;
    }
}

.hidden-sm {
    display: block !important;
}

@media (max-width: 767px) {
    .hidden-sm {
        display: none !important;
    }
}

.hidden-md {
    display: block !important;
}

@media (max-width: 1199px) {
    .hidden-md {
        display: none !important;
    }
}

/* ========================================
   TEXT UTILITIES
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.text-nowrap { white-space: nowrap; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.text-lowercase { text-transform: lowercase; }
.text-uppercase { text-transform: uppercase; }
.text-capitalize { text-transform: capitalize; }

.font-weight-light { font-weight: 300; }
.font-weight-normal { font-weight: 400; }
.font-weight-bold { font-weight: 700; }

.text-break { word-break: break-word; }

/* ========================================
   LINE HEIGHT UTILITIES
   ======================================== */

.lh-1 { line-height: 1; }
.lh-sm { line-height: 1.25; }
.lh-base { line-height: 1.5; }
.lh-lg { line-height: 2; }

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
    .d-md-none {
        display: none !important;
    }
    
    .d-md-block {
        display: block !important;
    }
    
    .d-md-flex {
        display: flex !important;
    }
}

@media (max-width: 576px) {
    .d-sm-none {
        display: none !important;
    }
    
    .d-sm-block {
        display: block !important;
    }


}

/* Full Width Page Container */
.full-width-container {
    margin-left: 0 !important;
    width: 100%;
}