/**
 * DDI Tables Mini-App Stylesheet
 * 
 * @package HIVClinic
 * @version 1.0.0
 */

/* Edit hover states */
.editHover {
    background-color: #E8F3FF;
}

.editBox {
    width: 326px;
    min-height: 20px;
    padding: 10px 15px;
    background-color: #fff;
    border: 2px solid #E8F3FF;
}

/* List and form styling */
li.noPad {
    padding: 0;
    width: 360px;
}

form {
    width: 100%;
}

.btnSave, .btnCancel {
    padding: 6px 30px 6px 75px;
}

/* Table styling */
table {
    padding: 0 10px;
}

.add-drug-form {
    display: none;
}

.add-drug-form button {
    margin-bottom: 20px;
}

/* Tablesorter styling */
th.header { 
    background-image: url(../wp-content/themes/hivclinic-master/images/bg.gif); 
    cursor: pointer; 
    font-weight: bold; 
    background-repeat: no-repeat; 
    background-position: center left; 
    padding-left: 20px; 
} 

th.headerSortDown { 
    background-image: url(../wp-content/themes/hivclinic-master/images/desc.gif); 
    background-color: #3399FF; 
}

th.headerSortUp { 
    background-image: url(../wp-content/themes/hivclinic-master/images/asc.gif); 
    background-color: #3399FF; 
}

th {
    text-align: center;
}

/* Layout containers */
.inner-container {
    display: flex;
}

.column {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
}

.column:first-child {
    margin-right: 10px;
}

/* Drug selection styling */
.selected-drug {
    background-color: #3399FF;
    color: white;
    font-weight: bold;
}

.primary-drug-list, .secondary-drug-list {
    list-style-type: none;
    padding: 0;
}

.primary-drug-list li, .secondary-drug-list li {
    cursor: pointer;
    padding: 5px;
    border: 1px solid #ccc;
    margin-bottom: 5px;
}

.primary-drug-list li:hover, .secondary-drug-list li:hover {
    background-color: #f0f0f0;
}

.reset-selection, .btn {
    margin-top: 10px;
}

.reset-selection:hover {
    background-color: #f0f0f0;
}

/* Control panel */
.controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.controls button {
    margin-left: 10px;
    margin-top: 0;
}

#content .controls p.banner {
    margin-bottom: 0px;
    line-height: 2.5;
}

.selList {
    font-weight: bold;
    background-color: #3399FF;
    padding: 5px 3px;
    border-radius: 5px;
    color: white;
}

.inputType {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
}

/* Modal Styles - Overrides for jQuery modal */
.modal {
    display: none;
    margin: 0 !important;
    position: fixed !important;
    z-index: 1000 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: auto !important;
    background-color: rgba(0,0,0,0.4) !important;
    /* Reset jQuery modal styles */
    vertical-align: baseline !important;
    max-width: none !important;
    box-sizing: border-box;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    position: relative;
    text-align: left;
    animation-duration: 0.4s;
    animation-fill-mode: both;
}

/* Modal Animation Styles */
.modal.show {
    display: block !important;
}

/* SlideDown animation keyframes */
@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* SlideUp animation keyframes */
@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100px);
        opacity: 0;
    }
}

/* Animation classes */
.modal-content.slide-down {
    animation-name: slideDown;
}

.modal-content.slide-up {
    animation-name: slideUp;
}

/* Backdrop fade animation */
.modal {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal.fade-in {
    animation-name: fadeIn;
}

.modal.fade-out {
    animation-name: fadeOut;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding: 20px 30px 15px 30px;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    background-color: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.close {
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    border: none;
    background: none;
    width: auto;
    height: auto;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    opacity: 0.7;
}

.modal-body {
    line-height: 1.6;
    padding: 20px 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body .drug-class-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid #3399FF;
}

.modal-body .drug-class-info h3 {
    margin-top: 0;
    color: #3399FF;
}

.drug-list-container {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
    margin-top: 10px;
}

.drug-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drug-list li {
    padding: 4px 8px;
    margin: 2px 0;
    background-color: white;
    border-radius: 3px;
    border: 1px solid #eee;
    font-size: 14px;
}

.drug-list li:nth-child(odd) {
    background-color: #f8f9fa;
}

.drug-count {
    font-weight: bold;
    color: #3399FF;
    font-size: 12px;
    margin-top: 5px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 0;
    padding: 15px 30px 20px 30px;
    border-top: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-footer .btn-primary {
    background-color: #3399FF;
    color: white;
}

.modal-footer .btn-primary:hover {
    background-color: #2080df;
}

.modal-footer .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background-color: #5a6268;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .modal-body {
        max-height: 70vh;
    }
}

/* Instructions toggle styling */
/* #show-instructions {
    float: right;
} */

#instructions-output {
    display: none; /* Initially hidden */
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #3399FF;
    border-radius: 4px;
}

#instructions-output p {
    margin-bottom: 10px;
}

#instructions-output p:last-child {
    margin-bottom: 0;
}

/* Active button state for show-instructions */
.btn.active {
    background-color: #3399FF;
    color: white;
    border-color: #2080df;
}

.btn.active:hover {
    background-color: #2080df;
    border-color: #1a6bbf;
}


/* Drug count badge styling */
.drug-count-badge {
    display: inline-block;
    background-color: #3399FF;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}

/* Hover effect for list items with count badges */
.primary-drug-list li:hover .drug-count-badge,
.secondary-drug-list li:hover .drug-count-badge {
    background-color: #2080df;
}

/* Selected state for count badges */
.selected-drug .drug-count-badge {
    background-color: white;
    color: #3399FF;
}

/* Zero count styling (optional - for empty classes) */
.drug-count-badge.zero-count {
    background-color: #ccc;
    color: #666;
}