/**
 * Options Trading Journal Frontend Styles
 */

/* Base Styles */
.otj-container {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin: 20px 0;
}

/* Tabs */
#otj-tabs {
    margin-top: 20px;
}

/* Message Box */
.otj-message-box {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.otj-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.otj-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.otj-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

#otj-message-container {
    margin-bottom: 20px;
}

/* Table Styles */
.otj-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 13px;
    line-height: 1.4;
}

.otj-table th,
.otj-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
}

.otj-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.otj-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.otj-table tr:hover {
    background-color: #f5f5f5;
}

.otj-table .positive {
    color: #28a745;
    font-weight: bold;
}

.otj-table .negative {
    color: #dc3545;
    font-weight: bold;
}

/* Loading State */
.otj-loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.otj-trades-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

/* Forms */
.otj-form {
    margin-top: 20px;
}

.otj-form-row {
    display: flex;
    margin-bottom: 15px;
    gap: 20px;
}

.otj-form-field {
    flex: 1;
}

.otj-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #23282d;
}

.otj-form-field input,
.otj-form-field select,
.otj-form-field textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.otj-full-width {
    flex: 0 0 100%;
}

.otj-submit-field {
    margin-top: 10px;
    text-align: right;
}

.otj-submit-field button {
    margin-left: 10px;
}

/* Filters */
.otj-filters, 
.otj-report-filters {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.otj-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
}

.otj-filter-field {
    flex: 1 1 200px;
    margin-right: 15px;
    margin-bottom: 10px;
}

.otj-filter-field:last-child {
    margin-right: 0;
}

.otj-filter-field input,
.otj-filter-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Pagination */
.otj-pagination {
    margin: 20px 0;
    text-align: center;
}

.otj-pagination .page-numbers {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}

.otj-pagination .page-numbers.current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.otj-pagination .page-numbers:hover {
    background-color: #f5f5f5;
}

/* Bulk Actions */
.otj-bulk-actions {
    margin-bottom: 10px;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.otj-bulk-actions select {
    margin-right: 10px;
}

.otj-bulk-actions .button {
    margin-right: 5px;
}

/* Checkbox Column */
.otj-check-column {
    width: 30px;
    text-align: center;
}

.otj-check-column input[type="checkbox"] {
    margin: 0;
}

/* Modal Styles */
.otj-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.otj-modal-content {
    position: relative;
    background-color: #fff;
    margin: 2% auto;
    padding: 20px;
    border: 1px solid #ddd;
    width: 80%;
    max-width: 800px;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.otj-small-modal {
    max-width: 500px;
}

.otj-modal-close {
    position: absolute;
    right: 10px;
    top: 5px;
    color: #666;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.otj-modal-close:hover {
    color: #000;
}

/* Bulk Instructions */
.otj-bulk-instructions {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.otj-bulk-instructions h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.otj-bulk-instructions code,
.otj-bulk-instructions pre {
    background-color: #f1f1f1;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.otj-bulk-instructions pre {
    padding: 10px;
    overflow-x: auto;
}

/* Report Sections */
.otj-report-section {
    margin-bottom: 30px;
}

.otj-report-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.otj-report-table-container {
    overflow-x: auto;
}

.otj-report-table tfoot tr {
    font-weight: bold;
    background-color: #e9ecef;
}

/* Action Buttons */
.otj-action-btn {
    padding: 5px 10px;
    margin-right: 5px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
}

.otj-edit-btn {
    background-color: #007bff;
    color: white;
}

.otj-exit-btn {
    background-color: #28a745;
    color: white;
}

.otj-delete-btn {
    background-color: #dc3545;
    color: white;
}

.otj-action-btn:hover {
    opacity: 0.8;
}

.button-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.button-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

.otj-actions {
    display: flex;
    gap: 5px;
}

.otj-edit-btn,
.otj-delete-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.otj-edit-btn {
    background-color: #4CAF50;
    color: white;
}

.otj-edit-btn:hover {
    background-color: #45a049;
}

.otj-delete-btn {
    background-color: #f44336;
    color: white;
}

.otj-delete-btn:hover {
    background-color: #da190b;
}

/* Clickable Exit Cell */
.otj-clickable {
    cursor: pointer;
    color: #2196F3;
}

.otj-clickable:hover {
    text-decoration: underline;
}

/* Message Styles */
.otj-message {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 3px;
    font-size: 13px;
}

.otj-message.success {
    background-color: #ecf7ed;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.otj-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.otj-message.info {
    background-color: #cce5ff;
    border: 1px solid #b8daff;
    color: #004085;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .otj-table {
        display: block;
        overflow-x: auto;
    }
    
    .otj-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .otj-modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Transaction type and option type styling */
.transaction-type-SELL,
select option[value="SELL"] {
    color: #d63638 !important; /* WordPress red */
    font-weight: 500;
}

.option-type-PE,
select option[value="PE"] {
    color: #d63638 !important; /* WordPress red */
    font-weight: 500;
}

/* Important values that need to stay their current color */
.otj-table .positive,
.otj-table .negative {
    color: inherit;
}

/* Form sections */
.otj-form-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.otj-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.otj-form-section h3 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #23282d;
}

/* P&L information */
.otj-pnl-info {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
}

.otj-pnl-info p {
    margin: 0 0 5px 0;
}

.otj-pnl-info .positive {
    color: #28a745;
    font-weight: bold;
}

.otj-pnl-info .negative {
    color: #dc3545;
    font-weight: bold;
}

/* Form actions */
.otj-form-actions {
    margin-top: 20px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.otj-form-actions button {
    margin-left: 10px;
}

/* Trade Summary */
.otj-trade-summary {
    margin-bottom: 20px;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
}

.otj-trade-summary p {
    margin: 5px 0;
}

.otj-trade-summary .trade-id {
    color: #666;
    font-size: 12px;
}

.otj-trade-summary .key-info {
    font-weight: bold;
}

/* Add these class selectors at the end of the file */ 