/* 
 * CSS Variables for consistent theming
 * 
 * Usage in CSS: background-color: var(--color-webex-blue);
 * Usage in JS: element.style.backgroundColor = 'var(--color-success)';
 * 
 * Available variables:
 * --color-success: Success state (green)
 * --color-success-hover: Success hover state
 * --color-danger: Error/danger state (red)
 * --color-danger-hover: Danger hover state
 * --color-error-bg: Error message background (light red)
 * --color-error-text: Error message text color
 * --color-webex-blue: Primary brand color
 * --color-webex-blue-hover: Primary brand hover color
 * --color-background: Page background color (light gray)
 */
 :root {
    --color-success: #28a745;
    --color-success-hover: #218838;
    --color-danger: #dc3545;
    --color-danger-hover: #c82333;
    --color-error-bg: #fee;
    --color-error-text: #721c24;
    --color-webex-blue: #00bceb;
    --color-webex-blue-hover: #0099ba;
    --color-background: #f5f5f5;
}

* {
    box-sizing: border-box;
}

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0, 0, 0, .5);
    box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--color-background);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header_anchor{
    text-decoration: none;
}

#header {
    position: sticky;
    top: 0;
    background-color: var(--color-webex-blue);
    color: white;
    padding: 20px;
    margin: 0;
    text-align: left; /* Align the title text to the left */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
    z-index: 1000; /* Ensure the header is above other content */
}

#body {
    flex: 1;
    padding: 20px;
}

#footer {
    background-color: var(--color-background);
    text-align: center;
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}

#footer a {
    color: var(--color-webex-blue);
    text-decoration: none;
    font-weight: bold;
}

#footer a:hover {
    text-decoration: underline;
}

/* Rest of the CSS for form and results remains the same */

form#search-form {
    padding: 10px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

input[type="text"],
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background-color: var(--color-webex-blue);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--color-webex-blue-hover);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid #ccc;
}

th, td {
    padding: 10px;
    text-align: left;
}

th {
    background-color: var(--color-background);
}

.search-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: auto;
    width: 100%;
    padding: 20px; /* Add padding for spacing */
    box-sizing: border-box; /* Include padding in the width calculation */
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.form-group {
    flex: 1 1 25%; /* Each form group will take up half the width of the form-row */
    padding: 0 10px;
    box-sizing: border-box;
}

.full-width {
    margin: 0 10px; /* Add margin to maintain spacing */
}

.results-container {
    width: 100%;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: auto;
    margin-top: 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .form-group {
        flex: 1 1 100%; /* Each form group will take up the full width on smaller screens */
        padding: 0 10px; /* Adjust padding for smaller screens */
    }
}

.changelog-item {
    padding-bottom: 20px;
    margin-bottom: 20px; /* Space between changelog items */
    border-bottom: 3px solid #e4e5e6;
}

.changelog-item h2, .changelog-item h3 {
    color: #333;
    margin-bottom: 10px;
}

.changelog-item .commits{
    margin-top: 20px;
    margin-bottom: 20px;
}

.changelog-item .commits ul {
    margin-top: 10px;
    list-style-type: none;
    padding: 0;
    max-height: 200px;
    overflow: scroll;
}

.changelog-item .commits ul li {
    background-color: #eee;
    margin-bottom: 5px;
    padding: 10px;
    border-radius: 3px;
    word-wrap: break-word;
}

.changelog-item .commit-hash {
    font-family: monospace;
}

.changelog-item .related-packages{
    position: relative;
}

.changelog-item .related-packages .table-wrapper{
    max-height: 200px;
    overflow: scroll;
    border: 1px solid #ddd;
    margin-top: 10px;
}

.changelog-item .related-packages table {
    width: 100%;
    border-collapse: collapse;
}


.changelog-item table thead{
    position: sticky;
    top: -1px;
}

.changelog-item th, .changelog-item td {
    border: 1px solid #ddd;
}

.changelog-item th, .changelog-item td {
    padding: 10px;
    text-align: left;
}

.changelog-item th {
    background-color: #f7f7f7;
}

.changelog-item tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}

.changelog-item tbody tr:hover {
    background-color: #f1f1f1;
}

.copy-button {
    display: inline;
    position: absolute;
    margin-left: 5px;
    cursor: pointer;
    right: 0px;
}

.copy-button img {
    width: 20px;
    height: auto;
    margin-right: 5px;
}

footer {
    margin: 20px 0px;
}

footer .copyright {
    text-align: center;
    margin: 0 auto;
}

.alert-info {
    background-color: #f0f9ff;
    border-left: 6px solid var(--color-webex-blue);
    color: #333;
    padding: 10px;
    margin-bottom: 20px;
}

.alert-info p.note {
    font-weight: bold;
    color: var(--color-webex-blue);
}

.alert-info p.warning {
    font-weight: bold;
    color: #ff7f0e;
    display: inline;
}

/* ============================================
   VERSION COMPARISON STYLES
   ============================================ */

/* Mode Toggle Buttons */
.mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-toggle button {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--color-webex-blue);
    background-color: white;
    color: var(--color-webex-blue);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    font-weight: 500;
}

.mode-toggle button:hover {
    background-color: #e6f7fb;
}

.mode-toggle button.active {
    background-color: var(--color-webex-blue);
    color: white;
}

/* Hide utility class */
.hide {
    display: none !important;
}

/* Comparison Form */
#comparison-form {
    margin-top: 20px;
}

/* Comparison Results Table */
#comparison-results .table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
    position: relative;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    font-size: 14px;
}

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

.comparison-table th {
    background-color: var(--color-webex-blue);
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-table tbody tr {
    transition: background-color 0.2s;
}

.comparison-table tbody tr:hover {
    background-color: var(--color-background) !important;
}

/* Color Coding for Changes */
.comparison-table tr.version-changed {
    background-color: #fff3cd; /* Yellow - version changed */
    border-left: 4px solid #ffc107;
}

.comparison-table tr.only-in-a {
    background-color: #f8d7da; /* Red - removed in B */
    border-left: 4px solid #dc3545;
}

.comparison-table tr.only-in-b {
    background-color: #d4edda; /* Green - added in B */
    border-left: 4px solid #28a745;
}

.comparison-table tr.unchanged {
    background-color: #ffffff; /* White - no change */
}

/* Comparison Summary */
.comparison-summary {
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f9ff 100%);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 5px solid var(--color-webex-blue);
}

.comparison-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--color-webex-blue);
    font-size: 1.5em;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    padding: 10px 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.stat-item.changed {
    border-left: 4px solid #ffc107;
}

.stat-item.unchanged {
    border-left: 4px solid #6c757d;
}

.stat-item.added {
    border-left: 4px solid #28a745;
}

.stat-item.removed {
    border-left: 4px solid #dc3545;
}

.stat-item strong {
    font-size: 1.2em;
    color: #333;
}