/* Tools Layout */
.tools-layout {
    display: flex;
    height: calc(100vh - 180px);
    gap: 20px;
    margin-top: 20px;
}

/* Strength Index Calculator Styles */
.rsi-jump-height-inputs,
.rsi-flight-time-inputs,
.dsi-inputs {
    margin-top: 15px;
}

.rsi-jump-height-inputs .form-group,
.rsi-flight-time-inputs .form-group,
.dsi-inputs .form-group {
    margin-bottom: 15px;
}

.strength-index-calculate-btn {
    margin-top: 20px;
}

/* Article Library Filter Styles */
.research-articles-option {
    color: #007bff !important; /* Blue for Research Articles */
    font-weight: 600;
}

.academic-articles-option {
    color: #28a745 !important; /* Green for Academic Articles */
    font-weight: 600;
}

/* Article Library Category Dots */
.category-dot.research-articles {
    background-color: #007bff;
    color: white;
}

.category-dot.academic-articles {
    background-color: #28a745;
    color: white;
}

/* Outline style support for Article Library dots */
body.outline-dots .category-dot.research-articles {
    background-color: transparent;
    border: 2px solid #007bff;
    color: white;
}

body.outline-dots .category-dot.academic-articles {
    background-color: transparent;
    border: 2px solid #28a745;
    color: white;
}

/* Article Library Add Modal Styling */
.subfilter-section-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.filter-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.filter-bubble {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

/* Master filter bubbles styling */
.filter-bubble.master-filter {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid #555;
    font-weight: bold;
    font-size: 14px;
    padding: 8px 16px;
    margin-right: 10px;
    margin-bottom: 5px;
}

.filter-bubble.master-filter:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: #777;
}

.filter-bubble.master-filter.selected {
    background: black;
    border-color: black;
    color: white;
    font-weight: bold;
}

.filter-bubble:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-bubble.selected {
    background: #000000;
    border-color: #000000;
    color: white;
    font-weight: 500;
}

.filter-bubble.selected:hover {
    background: #333333;
    border-color: #333333;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #ccc;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.form-input::placeholder {
    color: #888;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: black;
    color: white;
}

.modal-btn.primary:hover {
    background: #333333;
}

/* Article Library Category Header Styling */
.category-section {
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.category-checkbox {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.category-label {
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
}

.subfilter-group {
    margin-bottom: 15px;
}

.subfilter-label {
    display: block;
    color: #ccc;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Article Name Input Styling */
.article-name-input {
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    font-size: 16px !important;
    padding: 12px 15px !important;
    margin-top: 8px !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.article-name-input:focus {
    border-color: white !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.article-name-input::placeholder {
    color: #aaa !important;
    font-style: italic;
}

/* Article Metadata Input Fields Styling */
.article-authors-input,
.article-contributors-input {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.article-authors-input:focus,
.article-contributors-input:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

.article-date-published-input,
.article-recent-edit-input {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: white !important;
}

.article-date-published-input:focus,
.article-recent-edit-input:focus,
.article-doi-input:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.article-doi-input {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.article-doi-input::placeholder {
    color: #aaa !important;
    font-style: italic;
}

/* Article Sections Styling */
.article-sections {
    margin: 20px 0;
}

.article-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.article-section:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.section-title-input {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.section-title-input:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

.section-paragraph-input {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    resize: vertical;
    min-height: 60px;
}

.section-paragraph-input:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

.add-section-btn {
    background: black !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
}

.remove-section-btn {
    background: rgba(220, 53, 69, 0.8) !important;
    color: white !important;
    border: none !important;
    padding: 4px 8px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    transition: background-color 0.2s ease !important;
}

.remove-section-btn:hover {
    background: rgba(220, 53, 69, 1) !important;
}







.tools-sidebar {
    width: 320px;
    background-color: #1a1a1a;
    border-right: 1px solid #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tools-search {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.tools-search input {
    width: 100%;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
}

.tools-search input::placeholder {
    color: #999;
}

.tools-list {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding-right: 0;
    margin: 0;
    border-collapse: collapse;
    align-items: start;
}

.tool-button {
    aspect-ratio: 1;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 0;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease, opacity 0.2s ease, visibility 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px;
    word-wrap: break-word;
    line-height: 1.2;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    position: relative;
}

.tool-button:hover {
    background-color: #444;
    border-color: #666;
}

.tool-button.active {
    background-color: #555;
    border-color: #888;
}

.tool-heart {
    position: absolute;
    top: 4px;
    right: 6px;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.tool-heart.filled { color: #e83e8c; }

/* Remove right border from first button in each row */
.tool-button:nth-child(odd) {
    border-right: none;
}

/* Remove left border from second button in each row */
.tool-button:nth-child(even) {
    border-left: none;
}

/* Remove bottom border from all buttons except last row */
.tool-button:nth-child(-n+6) {
    border-bottom: none;
}

.tools-main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.tool-modal {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: #1a1a1a;
    border-left: 1px solid #333;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

.tool-modal.active {
    transform: translateX(0);
}

.tool-modal { right: 50%; }
.tool-modal:nth-child(2) { right: 0; z-index: 9; }

.tool-modal:nth-child(2).active {
    transform: translateX(0);
}

.tool-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-modal-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.tool-modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-modal-close:hover {
    color: white;
}

.tool-modal-content {
    padding: 20px;
    height: calc(100% - 60px);
    overflow-y: auto;
}

/* Ensure save icons never show inside tool modals */
.tool-modal .tool-heart,
.tool-modal .heart-btn {
    display: none;
}

.tool-modal-placeholder {
    color: #999;
    text-align: center;
    margin-top: 50px;
    font-size: 16px;
}

/* Calculator Form Styles */
.calculator-form {
    padding: 20px 0;
}

.calculator-form .form-group {
    margin-bottom: 20px;
}

.calculator-form .form-label {
    display: block;
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.calculator-form .form-input {
    width: 100%;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.calculator-form .form-input:focus {
    outline: none;
    border-color: #666;
}

.calculate-btn {
    background-color: #555;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.calculate-btn:hover {
    background-color: #666;
}

.result-display {
    margin-top: 20px;
    padding: 15px;
    background-color: #333;
    border-radius: 6px;
    border: 1px solid #555;
    min-height: 50px;
    display: none;
}

.result-display.show {
    display: block;
}

.result-text {
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
}

/* Timer Styles */
.timer-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.timer-display {
    text-align: center;
    margin-bottom: 20px;
}

.timer-time {
    font-size: 48px;
    font-weight: bold;
    color: white;
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
}

.timer-rounds {
    font-size: 16px;
    color: #ccc;
    font-weight: 500;
}

.timer-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
}

.timer-mode-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.timer-mode-btn {
    background-color: #444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timer-mode-btn:hover {
    background-color: #555;
}

.timer-mode-btn.active {
    background-color: #000;
}

.timer-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cod-inputs-container {
    margin-bottom: 1.5rem;
}

.cod-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.cod-test-column h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.cod-test-rows {
    margin-bottom: 1rem;
}

.cod-test-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
    align-items: start;
}

.cod-test-row .cod-test-column {
    display: flex;
    flex-direction: column;
}

.cod-controls {
    text-align: center;
    margin-bottom: 1rem;
}

.cod-add-row-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.cod-add-row-btn:hover {
    background: #5a6268;
}

/* Energy System Targeting Styles */
.energy-system-info {
    margin-bottom: 1.5rem;
}

.info-box {
    background: #333333;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    color: white;
}

.info-box h4 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-size: 1rem;
}

.ratio-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: white;
}

.sets-table-container {
    margin-bottom: 1.5rem;
}

.sets-table-container h4 {
    margin: 0 0 1rem 0;
    color: white;
    font-size: 1rem;
    font-weight: normal;
}

.sets-table {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.table-header {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 1fr;
    background: #333333;
    color: white;
    font-weight: normal;
}

.header-cell {
    padding: 0.75rem;
    text-align: center;
    border-right: 1px solid #dee2e6;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-cell:last-child {
    border-right: none;
}

.set-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 1fr;
    border-bottom: 1px solid #dee2e6;
    align-items: center;
    min-height: 3.5rem;
}

.set-row:last-child {
    border-bottom: none;
}

.set-cell {
    padding: 0.5rem;
    text-align: center;
    border-right: 1px solid #dee2e6;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
}

.set-cell:last-child {
    border-right: none;
}

.set-cell input {
    width: 100%;
    text-align: center;
    border: none;
    background: #333;
    color: white;
    font-size: 0.9rem;
    padding: 0.25rem;
    box-sizing: border-box;
}

.set-cell input:focus {
    outline: none;
    background: #333;
    border: 1px solid #666;
}

.ratio-display {
    font-weight: 600;
    color: #495057;
}

.status-display {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.status-display.target {
    background: #d4edda;
    color: #155724;
}

.status-display.too-long-rest {
    background: #fff3cd;
    color: #856404;
}

.status-display.too-short-rest {
    background: #f8d7da;
    color: #721c24;
}

.table-controls {
    text-align: center;
    margin-bottom: 1rem;
}

.add-set-btn, .remove-set-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 0 0.5rem;
    transition: background-color 0.2s;
}

.add-set-btn:hover, .remove-set-btn:hover {
    background: #5a6268;
}

.remove-set-btn {
    background: #dc3545;
}

.remove-set-btn:hover {
    background: #c82333;
}

.timer-settings .form-group:nth-child(3),
.timer-settings .form-group:nth-child(4) {
    grid-column: 1 / -1;
}

.timer-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.timer-btn {
    background-color: #555;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.timer-btn:hover {
    background-color: #666;
}

.timer-btn.start {
    background-color: #28a745;
}

.timer-btn.start:hover {
    background-color: #218838;
}

.timer-btn.pause {
    background-color: #ffc107;
    color: #000;
}

.timer-btn.pause:hover {
    background-color: #e0a800;
}

.timer-btn.reset {
    background-color: #000;
}

.timer-btn.reset:hover {
    background-color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tools-layout {
        flex-direction: column;
        height: auto;
    }
    
    .tools-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #333;
    }
    
    .tools-main {
        height: 400px;
    }
    
    .tool-modal {
        width: 100%;
        right: 0;
    }
    
    .tool-modal:nth-child(2) {
        right: 0;
    }
}
