/* Custom fixes for SSTrade Platform */

/* Dropdown menu fixes */
.dropdown-menu {
    display: none;
    min-width: 12rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #212529;
    text-align: left;
    background-color: #fff;
    background-clip: padding-box;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-weight: 400;
    color: #3a3a3a;
    transition: all 0.15s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
    color: #16181b;
    text-decoration: none;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}

.dropdown-item i.material-icons {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    color: #7b809a;
}

.dropdown-item.text-danger i.material-icons {
    color: #ea0606;
}

/* Fix for modals */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

.modal-open {
    overflow: hidden;
}

/* Fix for select boxes */
.form-select {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #d2d6da;
    border-radius: 0.5rem;
    transition: all 0.15s ease-in-out;
}

.form-select:focus {
    border-color: #e91e63;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.25);
}

/* Action buttons in tables */
.table td.align-middle .dropdown > a {
    cursor: pointer;
    color: #7b809a;
}

.table td.align-middle .dropdown > a:hover {
    color: #344767;
}

.table td.align-middle .dropdown-menu {
    transform-origin: top;
    min-width: 215px;
}

/* Fix for modal closing issues */
body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

.modal-dialog {
    margin-top: 3rem;
}

/* Admin search bar fixes */
.admin-search-bar {
    width: 300px;
    max-width: 100%;
}

.admin-search-bar .input-group-outline {
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.admin-search-bar .input-group-outline.is-focused {
    border-color: #e91e63;
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.25);
}

.admin-search-bar .input-group-text {
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.admin-search-bar .input-group-text i {
    color: #7b809a;
    font-size: 1.2rem;
}

/* Admin filters and pagination */
.admin-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-filters .form-select {
    min-width: 120px;
}

/* Fix for table actions column */
.table td.actions-cell {
    min-width: 100px;
    width: 100px;
}

/* Fix for input group outlines */
.input-group-outline.is-filled label.form-label {
    opacity: 0.6;
    transform: translateY(-1.25rem) scale(0.85);
}

.input-group-outline.is-focused label.form-label {
    color: #e91e63;
    opacity: 1;
    transform: translateY(-1.25rem) scale(0.85);
}

/* Mobile responsive fixes for signal pages */
@media (max-width: 767.98px) {
    /* Responsive tabs */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        min-width: auto;
    }

    /* Responsive button groups */
    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    /* Card responsive adjustments */
    .card {
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Responsive container adjustments */
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Responsive text sizes */
    h5 {
        font-size: 1.1rem;
    }

    h6 {
        font-size: 0.95rem;
    }

    /* Responsive badge adjustments */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Responsive image containers */
    .text-center img {
        max-width: 100%;
        height: auto;
    }
}
