/**
 * SOFA-1 Version Changer Status Page Branding
 * Primary Color: #001D3D (Dark Blue)
 * Font: Josefin Sans
 */

/* Font Face Declarations */
@font-face {
    font-family: 'Josefin Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/josefin-sans-v34-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Josefin Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/josefin-sans-v34-latin-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Josefin Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/josefin-sans-v34-latin-600.woff2') format('woff2');
}

/* Global Styles */
body {
    font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 20px;
    background-color: #f5f7fa;
}

/* Header Styles */
h2 {
    color: #001D3D;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #001D3D;
}

/* Statistics Box */
.stats {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #001D3D;
    color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 29, 61, 0.15);
    flex: 1;
    min-width: 300px;
}

.stats-item {
    display: block;
    font-weight: 400;
}

.stats-item:last-of-type {
    margin-bottom: 0;
}

.stats-item strong {
    font-weight: 700;
}

.cache-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* Version Summary Box */
.version-summary {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 29, 61, 0.1);
    border-left: 4px solid #001D3D;
    flex: 1;
    min-width: 300px;
}

.version-summary h5 {
    color: #001D3D;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1rem;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.summary-item strong {
    display: block;
    margin-bottom: 6px;
    color: #001D3D;
    font-weight: 700;
    font-size: 0.95rem;
}

.version-highlight {
    display: inline-block;
    padding: 4px 12px;
    background: #001D3D;
    color: white;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.1em;
    margin: 0 8px;
}

.version-count {
    color: #6c757d;
    font-size: 0.9em;
}

/* Outdated Section */
.outdated-section {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
}

.outdated-count {
    display: inline-block;
    padding: 4px 12px;
    background: #ff9800;
    color: white;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 8px;
}

.outdated-list {
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

.outdated-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #ff9800;
}

.outdated-item:last-child {
    margin-bottom: 0;
}

.outdated-repo-link {
    color: #001D3D;
    text-decoration: none;
    font-weight: 600;
    flex: 1;
}

.outdated-repo-link:hover {
    color: #003566;
    text-decoration: underline;
}

.outdated-version {
    color: #ff9800;
    font-weight: 700;
    font-size: 0.9em;
    margin-left: 10px;
}

/* Success Section */
.success-section {
    background: #d4edda;
    border-left: 4px solid #2ecc71;
}

.success-message {
    margin: 8px 0 0 0;
    color: #155724;
    font-size: 0.95em;
}

/* Button Styles */
.btn-primary {
    background-color: #001D3D;
    border-color: #001D3D;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #003566;
    border-color: #003566;
}

.btn-primary:focus,
.btn-primary:active {
    background-color: #001D3D !important;
    border-color: #001D3D !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 29, 61, 0.5) !important;
}

.btn-outline-primary {
    color: #001D3D;
    border-color: #001D3D;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: #001D3D;
    border-color: #001D3D;
    color: white;
}

/* Search and Filter Section */
.search-input {
    flex: 1;
    max-width: 400px;
}

.form-control:focus {
    border-color: #001D3D;
    box-shadow: 0 0 0 0.2rem rgba(0, 29, 61, 0.25);
}

/* Table Styles */
table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 29, 61, 0.1);
}

thead {
    background-color: #001D3D;
    color: white;
}

thead th {
    font-weight: 700;
    border-bottom: none;
    padding: 1rem;
}

th {
    cursor: pointer;
    user-select: none;
}

th:hover {
    background-color: #003566;
}

th.sortable::after {
    content: ' ⇅';
    opacity: 0.5;
}

th.sorted-asc::after {
    content: ' ↑';
    opacity: 1;
}

th.sorted-desc::after {
    content: ' ↓';
    opacity: 1;
}

tbody tr:hover {
    background-color: rgba(0, 29, 61, 0.05);
}

tbody td {
    padding: 0.75rem 1rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-current {
    background-color: #2ecc71;
    color: white;
}

.status-outdated {
    background-color: #ff9800;
    color: white;
}

.status-installed {
    background-color: #2ecc71;
    color: white;
}

.status-not-installed {
    background-color: #e74c3c;
    color: white;
}

/* Repository Links */
.repo-link {
    color: #001D3D;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.repo-link:hover {
    color: #003566;
    text-decoration: underline;
}

/* Filter Section */
.filters {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Stats and Summary Container */
.stats-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Hidden Row State */
tr.hidden {
    display: none;
}

/* Setup Versioning Button */
.setup-versioning-btn,
.update-versioning-btn {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    transition: all 0.2s ease;
}

.setup-versioning-btn:disabled,
.update-versioning-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Update Button Specific Styles */
.btn-warning {
    background-color: #ff9800;
    border-color: #ff9800;
    color: white;
    font-weight: 600;
}

.btn-warning:hover {
    background-color: #f57c00;
    border-color: #f57c00;
    color: white;
}

/* Alert Notifications */
.alert {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .stats-item {
        display: block;
        margin-right: 0;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.9rem;
    }

    .btn-group .btn {
        font-size: 0.85rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Spinner Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
    display: inline-block;
}
