/* Floating Widget Base */
.pjm-floating-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: fixed;
    bottom: 75px;
    left: 20px;
    z-index: 999999;
}

/* Collapsed Pill View */
.pjm-pill-view {
    background: #800000;
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pjm-pill-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.pjm-pill-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
    border-right: 1px solid rgba(255,255,255,0.3);
    padding-right: 10px;
}
.pjm-pill-item:last-child {
    border-right: none;
    padding-right: 0;
}

.pjm-pill-name {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.pjm-pill-price {
    font-size: 0.8rem;
    font-weight: bold;
}

.pjm-pill-loading {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Expanded Full View */
.pjm-full-view {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 90vw;
    max-width: 600px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

/* Toggle Logic */
.pjm-collapsed .pjm-full-view { display: none; }
.pjm-collapsed .pjm-pill-view { display: flex; }

.pjm-expanded .pjm-full-view { display: flex; }
.pjm-expanded .pjm-pill-view { display: none; }

/* Header with Close Button */
.pjm-header {
    background: #800000;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pjm-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.pjm-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}
.pjm-close-btn:hover {
    opacity: 1;
}



.pjm-rates-table {
    width: 100%;
    border-collapse: collapse;
}

.pjm-rates-table th, .pjm-rates-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.pjm-rates-table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.pjm-rates-table tbody tr:hover {
    background-color: #f1f1f1;
}

.pjm-rates-table td {
    color: #555;
    font-size: 0.85rem;
}

.pjm-loading {
    text-align: center;
    color: #888;
    padding: 20px !important;
}

.pjm-flash-up {
    color: #28a745 !important;
    animation: flashGreen 1s;
}

.pjm-flash-down {
    color: #dc3545 !important;
    animation: flashRed 1s;
}

@keyframes flashGreen {
    0% { background-color: #d4edda; }
    100% { background-color: transparent; }
}

@keyframes flashRed {
    0% { background-color: #f8d7da; }
    100% { background-color: transparent; }
}

/* Responsive Table Wrapper */
.pjm-table-responsive {
    overflow-x: auto;
    width: 100%;
}

/* Base/Mobile adjustments */
@media screen and (max-width: 600px) {
    .pjm-floating-container {
        left: 50%;
        transform: translateX(-50%);
        width: max-content;
        max-width: 95vw;
        bottom: 70px;
    }
    
    .pjm-header h3 {
        font-size: 1rem;
    }
    .pjm-rates-table th, .pjm-rates-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
    .pjm-rates-table th {
        font-size: 0.7rem;
    }
}

/* Tablet adjustments */
@media screen and (min-width: 601px) and (max-width: 1024px) {
    .pjm-rates-table th {
        font-size: 0.8rem;
    }
    .pjm-rates-table td {
        font-size: 0.85rem;
    }
}

/* Desktop & Large Screen adjustments */
@media screen and (min-width: 1025px) {
    .pjm-rates-table th {
        font-size: 0.85rem;
    }
    .pjm-rates-table td {
        font-size: 0.95rem;
    }
    .pjm-header h3 {
        font-size: 1.15rem;
    }
}
