/* ===================================================
   MTC Pharmacy Subscriptions - Admin Template Styles
   =================================================== */

/* Common Styles */
form fieldset .row label {
    margin-top: 0px;
}

.page-actions {
    margin-bottom: 20px;
}

.page-actions .BUTTON {
    margin-right: 10px;
}

.reset-button a {
    display: block;
    float: left;
    clear: none;
    text-align: center;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    background: #0e55c1;
    background: -webkit-linear-gradient(top, #0d4cb1, #0744a7);
    background: -moz-linear-gradient(top, #0d4cb1, #043e9c);
    color: #fff !important;
    border: none;
    font-size: 1.1em;
    font-family: "OpenSansSemibold";
    outline: none;
    min-width: 100px;
    width: auto;
    padding: 0 15px !important;
    margin-bottom: 5px;
    margin-right: 5px;
    height: 33px;
    line-height: 31px;
}

/* Stats Container */
.stats-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats-container .card {
    flex: 1;
    min-width: 150px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box {
    text-align: center;
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.card.active {
    background-color: #4a89dc;
    color: white;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.card.active a {
    color: white;
}

.stat-label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 22px;
    font-weight: bold;
}

/* Subscription Items */
.subscription-items {
    margin-top: 0.5rem;
}

.subscription-items .badge {
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Log Detail View Styles */
.user-agent {
    font-family: monospace;
    font-size: 0.875rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.25rem;
    word-break: break-all;
}

.changes-container {
    background: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
}

.change-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.change-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.change-field {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #495057;
}

.change-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.old-value {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.new-value {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.data-display {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.data-item,
.metadata-item {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f3f4;
}

.data-item:last-child,
.metadata-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.metadata-display pre {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Activity Timeline Styles */
.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-description {
    color: #495057;
    font-size: 0.95rem;
}

.current-log {
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    padding-left: 10px;
}

.current-log label {
    font-weight: bold;
    color: #007bff;
}

/* Timeline Container (for subscription logs page) */
.timeline-container {
    position: relative;
    margin-top: 1rem;
}

.timeline-entry {
    position: relative;
    display: flex;
    margin-bottom: 2rem;
    padding-left: 4rem;
}

.timeline-entry:last-child {
    margin-bottom: 0;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 3rem;
    bottom: -2rem;
    width: 2px;
    background: #e9ecef;
    z-index: 0;
}

.timeline-entry:last-child::before {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0.5rem;
    z-index: 1;
}

.marker-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-content {
    flex: 1;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-left: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.timeline-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.timeline-action {
    flex: 1;
}

.timeline-actions {
    margin-left: 1rem;
}

.timeline-source {
    color: #6c757d;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.timeline-time {
    color: #6c757d;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.timeline-description {
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 0.5rem;
}

.timeline-changes {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.timeline-meta {
    border-top: 1px solid #f1f3f4;
    padding-top: 0.5rem;
}

/* Badge Sizes */
.badge-lg {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.badge-xs {
    font-size: 0.65rem;
    padding: 0.125rem 0.25rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}
.badge{padding:0.25rem 0.5rem;border-radius:0.25rem;color:#fff;}
/* Status-based Badge Colors */
.badge-active { background-color: #28a745; }
.badge-pending { background-color: #ffc107; color: #000; }
.badge-paused { background-color: #fd7e14; }
.badge-cancelled { background-color: #dc3545; }
.badge-expired { background-color: #6c757d; }
.badge-payment-failed { background-color: #dc3545; }
.badge-completed { background-color: #17a2b8; }

/* Action Badge Colors */
.badge-created, .badge-updated { background-color: #007bff;}
.badge-status_changed { background-color: #ffc107; color: #000;}
.badge-item_added { background-color: #28a745; }
.badge-item_removed { background-color: #dc3545; }
.badge-item_updated { background-color: #17a2b8; }
.badge-order_generated { background-color: #6f42c1; }
.badge-payment_attempted { background-color: #fd7e14; }
.badge-payment_succeeded { background-color: #28a745; }
.badge-payment_failed { background-color: #dc3545; }
.badge-email_sent { background-color: #20c997; }
.badge-cancelled { background-color: #dc3545; }
.badge-paused { background-color: #ffc107; }
.badge-activated { background-color: #28a745; }
.badge-expired { background-color: #6c757d; }
.badge-deleted { background-color: #dc3545; }

/* Source Badge Colors */
.badge-Admin { background-color: #007bff; }
.badge-Customer { background-color: #28a745; }
.badge-System { background-color: #6c757d; }
.badge-Api { background-color: #17a2b8; }

/* Marker Colors (for timeline) */
.marker-created, .marker-updated { background-color: #007bff; }
.marker-status_changed { background-color: #ffc107; }
.marker-item_added { background-color: #28a745; }
.marker-item_removed { background-color: #dc3545; }
.marker-item_updated { background-color: #17a2b8; }
.marker-order_generated { background-color: #6f42c1; }
.marker-payment_attempted { background-color: #fd7e14; }
.marker-payment_succeeded { background-color: #28a745; }
.marker-payment_failed { background-color: #dc3545; }
.marker-email_sent { background-color: #20c997; }
.marker-cancelled { background-color: #dc3545; }
.marker-paused { background-color: #fd7e14; }
.marker-activated { background-color: #28a745; }
.marker-expired { background-color: #6c757d; }
.marker-deleted { background-color: #dc3545; }

/* Subscription Preferences Tooltip */
.subscription-tooltip {
    display: inline-block;
    margin-left: 4px;
    color: #6c757d;
    cursor: help;
    font-family: Verdana, Arial, sans-serif;
    font-size: 13px;
    font-weight: normal;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.subscription-tooltip:hover {
    color: #007bff;
    background-color: #e7f1ff;
    border-color: #007bff;
    transform: scale(1.1);
}

/* jQuery UI Tooltip customization for subscription preferences */
.ui-tooltip {
    font-family: Verdana, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
    max-width: 350px;
    min-width: 200px;
    background-color: #333 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    pointer-events: none;
    z-index: 9999;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
}

.ui-tooltip-content {
    background-color: #333 !important;
    color: #fff !important;
    padding: 0;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-entry {
        padding-left: 3rem;
    }

    .marker-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.875rem;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-actions {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .timeline-source,
    .timeline-time {
        display: block;
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .stats-container {
        flex-direction: column;
    }

    .change-values {
        grid-template-columns: 1fr;
    }
}