/* Modern CSS for Wellframe Version Check Service */

:root {
    --primary-color: #0A97BE;
    --secondary-color: #174f61;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    overflow-x: hidden;
}

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar gradient background class for reuse */
.sidebar-gradient {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%) !important;
}

.sidebar-gradient.alert {
    padding: 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%) !important;
    color: #fff;
}

.sidebar-gradient.alert .alert-heading {
    color: #fff;
}

.sidebar-gradient.alert code {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Sidebar - Always visible with scrollable navigation */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    transition: all var(--transition-speed);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* overflow: hidden; /* Prevent body scrollbar */
    left: 0;
    top: 0;
    /* Ensure sidebar is always visible - no collapsibility */
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar-header {
    padding: 12px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255, 0.75);
    flex-shrink: 0;
    /* Ensure header is always visible */
    visibility: visible !important;
    opacity: 1 !important;
}

/* User Info Section */
.user-info {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    /* Ensure user info is always visible */
    visibility: visible !important;
    opacity: 1 !important;
}

.user-avatar {
    flex-shrink: 0;
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.user-details {
    flex: 1;
    text-align: left;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.user-username {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8em;
}

.user-actions {
    flex-shrink: 0;
}

.user-actions .btn {
    padding: 6px 8px;
    font-size: 0.8em;
}

/* Login Section */
.login-section {
    margin-top: 15px;
    padding: 15px;
}

.login-section .btn {
    width: 100%;
    font-size: 0.9em;
    padding: 8px 12px;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-logo {
    max-width: 200px;
    height: auto;
}

.login-form .btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b8aa8 100%);
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.login-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(10, 151, 190, 0.4);
}

.login-footer .alert {
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
}

/* Remember Me Checkbox Styling */
.login-form .form-check {
    text-align: left;
    margin-bottom: 20px;
}

.login-form .form-check-input {
    margin-right: 8px;
}

.login-form .form-check-label {
    color: #666;
    font-size: 0.9em;
    cursor: pointer;
}

.login-form .form-check-label:hover {
    color: var(--primary-color);
}

.logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar .nav {
    padding: 15px 0 15px 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 280px); /* Adjusted to ensure all content fits */
    display: flex;
    flex-direction: column;
    /* Ensure navigation is always visible and scrollable */
    visibility: visible !important;
    opacity: 1 !important;
}

/* Custom scrollbar for sidebar */
.sidebar .nav::-webkit-scrollbar {
    width: 10px;
}

.sidebar .nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin: 5px 0;
}

.sidebar .nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Firefox scrollbar styling */
.sidebar .nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
}

.sidebar .nav-item {
    margin: 2px 15px;
    flex-shrink: 0; /* Prevent compression */
}

.sidebar .nav-item:last-child {
    margin-bottom: 20px; /* Add bottom margin to last item */
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8) !important;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white !important;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.2);
    color: white !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar .nav-link i {
    margin-right: 12px;
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

/* Sidebar Section Headers */
.sidebar-section-header {
    color: rgba(255,255,255,0.9);
    padding: 15px 15px 8px 15px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 15px 5px 15px;
    display: flex;
    align-items: center;
}

.sidebar-section-header i {
    margin-right: 8px;
    font-size: 0.9em;
    width: 16px;
    text-align: center;
}

/* Section Headers */
.section-header {
    color: rgba(255,255,255,0.9);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* Environments Section */
.environments-section {
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.75);
    margin-top: 6px;
    flex-shrink: 0; /* Prevent shrinking */
    /* Ensure environments section is always visible */
    visibility: visible !important;
    opacity: 1 !important;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
}

.environments-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
}

/* Select wrapper for dropdown arrows */
.select-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.dropdown-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8em;
    pointer-events: none;
    z-index: 1;
}

.environments-input-group .form-select {
    background: rgba(193, 193, 193, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.75);
    color: rgb(255, 255, 255);
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: 6px;
    flex: 1;
    /* Prevent horizontal overflow */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Remove any background images */
    background-image: none;
    padding-right: 12px;
}

.environments-input-group .form-select:focus {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.75);
    color: rgb(255, 255, 255);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    /* Remove any background images on focus */
    background-image: none;
}

/* Remove the pseudo-element arrow */
.environments-input-group .form-select::after {
    display: none;
}

.environments-input-group .form-select option {
    background: var(--secondary-color);
    color: white;
}

.environments-input-group .btn {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255,255,255,0.1);
    color: rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.environments-input-group .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(2px);
}

.environments-input-group .btn i {
    font-size: 0.9em;
}

/* Services Section */
.services-section {
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.75);
    margin-top: 6px;
    flex-shrink: 0; /* Prevent shrinking */
    /* Ensure services section is always visible */
    visibility: visible !important;
    opacity: 1 !important;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
}

.services-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
}

.services-input-group .form-select {
    background: rgba(193, 193, 193, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.75);
    color: rgb(255, 255, 255);
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: 6px;
    flex: 1;
    /* Prevent horizontal overflow */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Remove any background images */
    background-image: none;
    padding-right: 12px;
}

.services-input-group .form-select:focus {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.75);
    color: rgb(255, 255, 255);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    /* Remove any background images on focus */
    background-image: none;
}

/* Remove the pseudo-element arrow */
.services-input-group .form-select::after {
    display: none;
}

.services-input-group .form-select option {
    background: var(--secondary-color);
    color: white;
}

.services-input-group .btn {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255,255,255,0.1);
    color: rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.services-input-group .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(2px);
}

.services-input-group .btn i {
    font-size: 0.9em;
}

/* Personal Environment Input Section */
.persenv-section {
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.75);
    margin-top: 6px;
    flex-shrink: 0; /* Prevent shrinking */
    /* Ensure personal environment section is always visible */
    visibility: visible !important;
    opacity: 1 !important;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
}

.persenv-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
}

.persenv-input-group .form-control {
    background: rgba(193, 193, 193, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.75);
    color: rgb(255, 255, 255, 0.3);
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: 6px;
    flex: 1;
    /* Prevent horizontal overflow */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.persenv-input-group .form-control::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.persenv-input-group .form-control:focus {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.75);
    color: rgb(255, 255, 255);
}

.persenv-input-group .btn {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255,255,255,0.1);
    color: rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.persenv-input-group .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(2px);
}

.persenv-input-group .btn i {
    font-size: 0.9em;
}

/* Content Area */
.content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: all var(--transition-speed);
    min-height: 100vh;
    background-color: #f5f7fa;
    position: relative;
    z-index: 1;
}

/* Top Navigation */
.navbar {
    background: white !important;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 0;
}

/* Main Content */
.main-content {
    padding: 30px;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    transition: all var(--transition-speed);
}

.card:hover {
    box-shadow: 0 4px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: none;
    padding: 20px 25px;
}

.card-body {
    padding: 25px;
}

/* Tables */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all var(--transition-speed);
}

.table tbody tr:hover {
    background-color: rgba(10, 151, 190, 0.05);
}

/* Code blocks */
pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    font-size: 0.9em;
    line-height: 1.5;
    overflow-x: auto;
}

code {
    color: #4ad76d;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all var(--transition-speed);
    border: none;
    color: #000000;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b8aa8 100%);
    box-shadow: 0 2px 10px rgba(10, 151, 190, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(10, 151, 190, 0.4);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    padding: 20px;
}

/* Badges */
.badge {
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-width);
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        /* Ensure sidebar is always visible on mobile */
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .sidebar .nav {
        max-height: calc(100vh - 200px); /* Adjusted for mobile */
        overflow-y: auto;
        overflow-x: hidden;
        /* Ensure navigation is always visible and scrollable on mobile */
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .environments-section,
    .services-section,
    .persenv-section {
        padding: 8px 12px;
        margin: 5px 5px 0 5px;
    }
    
    .environments-input-group,
    .services-input-group,
    .persenv-input-group {
        flex-direction: column;
        gap: 6px;
    }
    
    .environments-input-group .btn,
    .services-input-group .btn,
    .persenv-input-group .btn {
        align-self: flex-end;
        width: auto;
        padding: 6px 10px;
    }
    
    .content {
        width: calc(100% - var(--sidebar-width));
        margin-left: var(--sidebar-width);
    }
    
    .main-content {
        padding: 20px 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Spinning Loading Icon */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 4px;
}

.spinner-xl {
    width: 48px;
    height: 48px;
    border-width: 6px;
}

/* Primary color spinner */
.spinner-primary {
    border-color: rgba(10, 151, 190, 0.3);
    border-top-color: var(--primary-color);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-overlay .spinner {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Loading text */
.loading-text {
    margin-top: 15px;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* Button loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Page loading indicator */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.page-loading.show {
    transform: translateX(0);
}

/* Spin animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active {
    background-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.75);
}

.status-inactive {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
} 

.ver-service {
    color: #000000 !important;
    font-size: medium !important;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.ver-branch {
    background-color: #afafaf !important;
    color: #000000 !important;
    font-size: medium !important;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.ver-commit {
    background-color: #dadada !important;
    color: #000000 !important;
    font-size: medium !important;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.ver-buildVersion {
    background-color: #65c5eb !important;
    color: #000000 !important;
    font-size: medium !important;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.ver-releaseVersion {
    background-color: #28a745 !important;
    color: #000000 !important;
    font-size: medium !important;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.ver-commitDateTime {
    color: #000000 !important;
    font-size: medium !important;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.env-header {
    color: rgba(255,255,255,0.9);
    padding: 15px 15px 8px 15px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 15px 15px 8px 15px;
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent shrinking */
}