/* JF Portfolio Plugin Styles */
.portfolio-container {
    /* nothing for now */
}
.portfolio-loading {
    text-align: center;
    padding: 20px;
}
.portfolio-error {
    color: #dc3545;
    padding: 10px;
    border: 1px solid #dc3545;
    border-radius: 4px;
    margin: 10px 0;
}
.performance-metrics {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}
.metric {
    text-align: center;
}
.metric span {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.holdings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.holdings-table th,
.holdings-table td {
    padding: 8px;
    border: 1px solid #222;
    text-align: left;
}
.holdings-table td {
    border: 1px solid #ddd;
}
.holdings-table th {
    background: #222;
    color: rgb(255, 255, 255);
    font-weight: normal;
}
.positive {
    color: #28a745;
}
.negative {
    color: #dc3545;
}
.debug-info {
    font-size: 12px;
    color: #666;
    margin: 5px 0;
    padding: 5px;
    background: #f8f9fa;
    border: 1px solid #ddd;
}

/* Latest Closed Widgets */
.widget_jf_portfolio_performance_widget h3 {
    margin-top: .5rem;
    font-size: 24px;
} 

/* Portfolio-specific table styles */
.portfolio-container.portfolio #portfolio-options th,
.portfolio-container.portfolio #portfolio-options td {
    padding: 8px;
    border: 1px solid #222;
}
.portfolio-container.portfolio #portfolio-options td {
    border: 1px solid rgb(221, 221, 221);
}
.portfolio-container.portfolio #portfolio-options th {
    background: #222;
    color: #fff;
    font-weight: normal;
}
.portfolio-container.portfolio #portfolio-options th:first-child,
.portfolio-container.portfolio #portfolio-options td:first-child {
    text-align: left;
}
.portfolio-container.portfolio #portfolio-options th:not(:first-child),
.portfolio-container.portfolio #portfolio-options td:not(:first-child) {
    text-align: right;
}

/* Transactions table styles */
.portfolio-container.transactions table.transactions th,
.portfolio-container.transactions table.transactions td {
    padding: 8px;
    border: 1px solid #222;
}
.portfolio-container.transactions table.transactions td {
    border: 1px solid rgb(221, 221, 221);
}
.portfolio-container.transactions table.transactions th {
    background: #222;
    color: #fff;
    font-weight: normal;
}
.portfolio-container.transactions table.transactions th:first-child,
.portfolio-container.transactions table.transactions td:first-child {
    text-align: left;
}
.portfolio-container.transactions table.transactions th:nth-child(2),
.portfolio-container.transactions table.transactions td:nth-child(2) {
    text-align: center;
}
.portfolio-container.transactions table.transactions th:nth-child(3),
.portfolio-container.transactions table.transactions td:nth-child(3),
.portfolio-container.transactions table.transactions th:nth-child(4),
.portfolio-container.transactions table.transactions td:nth-child(4) {
    text-align: right;
}

/* Color for Return % values */
.portfolio-container.transactions table.transactions td.positive {
    color: #28a745;
}
.portfolio-container.transactions table.transactions td.negative {
    color: #dc3545;
}

/* Options table styles */
.portfolio-container.options .options-portfolio-tools {
    margin-bottom: 1em;
    a.btn-light, div.btn-group, div.btn-group label {
        display: inline-block;
    }
    div.btn-group {
        margin-left: .5em;
    }
    div.btn-group input[type="radio"] {
        display: none;
    }
    div.btn-group label {
        background: #f8f9fa;
        color: #212529;
        border: 1px solid #dee2e6;
        padding: 8px 16px;
        border-radius: 4px;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s;
        display: inline-block;
        margin: 0;
    }
    div.btn-group label:hover, div.btn-group label.active {
        background: #e2e6ea;
        border-color: #adb5bd;
        color: #212529;
    }
    div.btn-group input[type="radio"]:checked + label {
        background: #007bff;
        color: #fff;
        border-color: #007bff;
    }
    div.btn-group input[type="radio"]:checked + label:hover {
        background: #0056b3;
        border-color: #0056b3;
    }
    a.btn-light {
        background: #f8f9fa;
        color: #212529;
        border: 1px solid #dee2e6;
        padding: 8px 16px;
        border-radius: 4px;
        text-decoration: none;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s;
        display: inline-block;
    }
    a.btn-light:hover {
        background: #e2e6ea;
        border-color: #adb5bd;
        color: #212529;
        text-decoration: none;
    }
    a.btn-light:focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        outline: none;
    }
}
.portfolio-container.options table.options-portfolio tr.expired {
    opacity: .5;
}
.portfolio-container.options table.options-portfolio th,
.portfolio-container.options table.options-portfolio td {
    padding: 8px;
    border: 1px solid #222;
}
.portfolio-container.options table.options-portfolio td {
    border: 1px solid rgb(221, 221, 221);
}
.portfolio-container.options table.options-portfolio th {
    background: #222;
    color: #fff;
    font-weight: normal;
}
.portfolio-container.options table.options-portfolio th:nth-child(n+2):nth-child(-n+7),
.portfolio-container.options table.options-portfolio td:nth-child(n+2):nth-child(-n+7) {
    text-align: right;
}
.portfolio-container.options table.options-portfolio div.strategy-info {
    float: left;
}
.portfolio-container.options table.options-portfolio div.return {
    float: right;
    font-weight: bold;
}
.portfolio-container.options table.options-portfolio span.equity-name {
    font-weight: bold;
    font-size: 30px;
}
.portfolio-container.options table.options-portfolio span.strategy-name {
    font-size: 20px;
}
.portfolio-container.options table.options-portfolio .strategy-data ul {
    margin-left: 0;
    margin-bottom: 0;
}
.portfolio-container.options table.options-portfolio .strategy-data ul li {
    list-style: none;
    display: inline-block;
}
.portfolio-container.options table.options-portfolio .strategy-data ul li label {
    display: inline-block;
    font-weight: bold;
    margin-right: .5em;
}
.portfolio-container.options table.options-portfolio .strategy-data ul li:not(:first-child) label {
    margin-left: 1em;
}

/* Dropdown alignment and appearance */
.dropdown-trigger-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    position: relative;
}
button.dropdown-toggle {
    background: #222;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: background 0.2s;
    float: right;
    bottom: 30px;
}
button.dropdown-toggle:hover, button.dropdown-toggle:focus {
    background: #444;
}
button.dropdown-toggle::after {
    content: '\25BC'; /* ▼ */
    margin-left: 8px;
    font-size: 0.9em;
    transition: transform 0.2s;
}
.dropdown-trigger-wrapper.open button.dropdown-toggle::after {
    content: '\25B2'; /* ▲ */
}
ul.dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    margin-top:6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    display: none;
    z-index: 100;
    float: right;
    margin-right: -168px;
    width: 120px;
}
ul.dropdown-menu.open {
    display: block;
}
ul.dropdown-menu li {
    border-bottom: 1px solid #eee;
}
ul.dropdown-menu li:last-child {
    border-bottom: none;
}
ul.dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: #222;
    text-decoration: none;
    transition: background 0.2s;
}
ul.dropdown-menu li a:hover {
    background: #f8f9fa;
}
ul.dropdown-menu li.header {
    font-weight: bold;
    color: #888;
    background: #f8f9fa;
    cursor: default;
    pointer-events: none;
}
#tool .btn-light {
    background: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    margin: 0;
}
#tool .btn-light:hover, #tool .btn-light.active {
    background: #e2e6ea;
    border-color: #adb5bd;
    color: #212529;
}
#tool .btn-light:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}
.holdings-table th:nth-child(2),
.holdings-table td:nth-child(2),
.holdings-table th:nth-child(3),
.holdings-table td:nth-child(3) {
    text-align: right;
}
