/* Responsive overrides for the XtremeIdiots Portal
-------------------------------------------------- */

/* General improvements */
body {
    font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Enhanced card styling */
.ibox {
    margin-bottom: 25px;
    background-color: #ffffff;
    border: 1px solid #e7eaec;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ibox-title {
    border-radius: 4px 4px 0 0;
}

.ibox-content {
    border-radius: 0 0 4px 4px;
}

/* Button improvements */
.btn {
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: #1ab394;
    border-color: #1ab394;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #18a689;
    border-color: #18a689;
}

/* Navigation improvements */
.nav>li>a {
    padding: 12px 20px;
    cursor: pointer;
}

.navbar-default.navbar-static-side {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

/* Improved navigation menu functionality */
.metismenu .arrow {
    float: right;
    margin-top: 2px;
    transition: transform 0.3s ease;
}

.metismenu .active>a>.fa.arrow {
    transform: rotate(90deg);
}

.metismenu .nav-second-level {
    padding-left: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.metismenu .nav-second-level.collapse:not(.show) {
    display: none;
}

.metismenu .nav-second-level.collapse.show {
    display: block;
}

.metismenu .nav-second-level li a {
    padding-left: 40px;
}

/* Tables improvements */
.table-responsive {
    border: none;
}

.dataTable.table-bordered {
    border-radius: 3px;
}

/* Enhanced content areas */
.wrapper-content {
    padding: 20px 25px 40px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .navbar-top-links {
        margin-right: 10px;
    }

    #page-wrapper {
        margin: 0;
        min-height: calc(100vh - 61px);
    }

    body.mini-navbar #page-wrapper {
        margin: 0;
    }

    .ibox-title {
        padding: 10px 15px;
    }

    .ibox-content {
        padding: 15px;
    }

    .footer {
        padding: 10px 15px;
    }

    .links a {
        display: block;
        margin-bottom: 5px;
    }

    .links .mx-2 {
        display: none;
    }
}

/* Better focus states for accessibility */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid #1ab394;
    outline-offset: 2px;
}

/* Table row hover effect */
.table-hover tbody tr:hover {
    background-color: #f8fafb;
}

/* Form control improvements */
.form-control:focus {
    border-color: #1ab394;
    box-shadow: none;
}

/* Font Awesome icons improvements */
.fa-fw {
    text-align: center;
    width: 1.25em;
}

/* Better notifications */
.label {
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
}

/* Better pagination */
.pagination>.active>a {
    background-color: #1ab394;
    border-color: #1ab394;
}

/* Navbar branding */
.navbar-minimalize {
    border-radius: 4px;
}

/* Footer styling */
.footer {
    border-top: 1px solid #e7eaec;
    padding: 15px 20px;
    background: #ffffff;
}

.footer a {
    color: #1ab394;
}

.footer a:hover {
    color: #18a689;
}

.cursor-pointer {
    cursor: pointer;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-start {
    align-items: flex-start !important;
}

.justify-content-center {
    justify-content: center !important;
}

.flex-grow-1 {
    flex-grow: 1 !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.mr-0 {
    margin-right: 0 !important;
}

.mr-1 {
    margin-right: 0.25rem !important;
}

.mr-3 {
    margin-right: 1rem !important;
}

.ml-1 {
    margin-left: 0.25rem !important;
}

.mx-1 {
    margin-left: 0.25rem !important;
    margin-right: 0.25rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-weight-bold {
    font-weight: bold !important;
}

.float-right {
    float: right !important;
}

.btn-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.btn-group .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.btn-group-vertical .btn {
    margin-bottom: 0.25rem;
}

.btn-group-vertical .btn:last-child {
    margin-bottom: 0;
}

.d-grid {
    display: grid !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

/* Responsive map */
.responsive-map {
    height: 300px;
    width: 100%;
}

/* Responsive navigation tabs */
.nav-tabs-responsive {
    flex-wrap: wrap;
}

.nav-tabs-responsive .nav-item {
    margin-bottom: 0.25rem;
}

.nav-tabs-responsive .nav-link {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
}

/* Medium devices and up */
@media (min-width: 768px) {
    .flex-md-row {
        flex-direction: row !important;
    }

    .align-items-md-center {
        align-items: center !important;
    }

    .mr-md-3 {
        margin-right: 1rem !important;
    }

    .mb-md-0 {
        margin-bottom: 0 !important;
    }

    .text-md-left {
        text-align: left !important;
    }

    .justify-content-md-start {
        justify-content: flex-start !important;
    }

    .responsive-map {
        height: 450px;
    }

    .btn-toolbar {
        justify-content: flex-start;
    }
}

/* Large devices and up */
@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }

    .mb-lg-0 {
        margin-bottom: 0 !important;
    }
}

/* Small devices - hide text in action buttons */
@media (max-width: 576px) {
    .btn-group .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    .nav-tabs-responsive .nav-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    .d-none {
        display: none !important;
    }

    .d-sm-inline {
        display: none !important;
    }

    /* Stack buttons vertically on very small screens */
    .btn-group-sm .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.25rem;
    }
}

/* Medium devices and up - show text in buttons */
@media (min-width: 576px) {
    .d-sm-inline {
        display: inline !important;
    }

    .flex-sm-row {
        flex-direction: row !important;
    }

    .mb-sm-0 {
        margin-bottom: 0 !important;
    }
}

/* Ensure tables are responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Make sure DataTables work well on mobile */
@media (max-width: 768px) {

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: center;
        margin-bottom: 1rem;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        margin-top: 1rem;
    }
}