:root {
    --primary-color: #00FF00;
    --secondary-color: #00CC00;
    --accent-color: #00FFFF;
    --text-color: #00FF00;
    --light-color: #001100;
    --dark-color: #000000;
    --success-color: #00FF33;
    --warning-color: #FFCC00;
    --danger-color: #FF0000;
    --matrix-bg: #000000;
    --matrix-glow: 0 0 10px rgba(0, 255, 0, 0.7);
    --matrix-border: 1px solid #00FF00;
}

@font-face {
    font-family: 'Matrix';
    src: url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Source Code Pro', 'Courier New', monospace;
}

body {
    background-color: var(--matrix-bg);
    color: var(--text-color);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.97), rgba(0, 0, 0, 0.97)),
                repeating-linear-gradient(transparent, transparent 2px, rgba(0, 20, 0, 0.5) 2px, rgba(0, 20, 0, 0.5) 4px);
    pointer-events: none;
    z-index: -1;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Login Styles */
#login-container {
    justify-content: center;
    align-items: center;
    background: transparent;
    position: relative;
    z-index: 1;
}

#login-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.login-box {
    background-color: rgba(0, 20, 0, 0.8);
    border: var(--matrix-border);
    border-radius: 5px;
    box-shadow: 0 8px 16px rgba(0, 255, 0, 0.2), 0 0 10px rgba(0, 255, 0, 0.7);
    padding: 40px;
    width: 400px;
    max-width: 90%;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transform-style: preserve-3d;
}

.login-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)),
                repeating-linear-gradient(transparent, transparent 2px, rgba(0, 20, 0, 0.5) 2px, rgba(0, 20, 0, 0.5) 4px);
    pointer-events: none;
    z-index: -1;
}

.login-box h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    text-shadow: var(--matrix-glow);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logo {
    margin-bottom: 20px;
}

#logo-img {
    width: 120px;
    height: auto;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

.input-group input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: var(--matrix-border);
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--primary-color);
    border-radius: 0;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: inset 0 0 5px rgba(0, 255, 0, 0.2);
}

.input-group input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 10px var(--accent-color);
}

.input-group input::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

.btn {
    background-color: transparent;
    color: var(--primary-color);
    border: var(--matrix-border);
    border-radius: 0;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: rgba(0, 255, 0, 0.2);
    box-shadow: var(--matrix-glow);
}

.btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.4), transparent);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.btn-secondary {
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(0, 255, 0, 0.1);
}

/* MFA Styles */
.mfa-info {
    color: var(--accent-color);
    font-size: 0.8rem;
    margin: 10px 0 20px;
    text-align: center;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.form-actions .btn {
    width: calc(50% - 5px);
}

/* Updated MFA Setup Container Styles */
.mfa-setup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.mfa-qr-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#mfa-qr-code {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#mfa-qr-code img {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.secret-key {
    margin-top: 20px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 5px;
    width: 100%;
}

.secret-key p {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.secret-key code {
    background: #000;
    padding: 5px 10px;
    border: 1px solid #00FF00;
    display: inline-block;
    margin-top: 5px;
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--primary-color);
}

.mfa-setup-instructions {
    color: var(--primary-color);
    width: 100%;
}

.mfa-setup-instructions h3 {
    margin-bottom: 15px;
    color: var(--accent-color);
}

.mfa-setup-instructions ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.mfa-setup-instructions li {
    margin-bottom: 10px;
}

.mfa-setup-actions {
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

/* Dashboard Styles */
header {
    background-color: rgba(0, 10, 0, 0.9);
    border-bottom: var(--matrix-border);
    box-shadow: 0 2px 10px rgba(0, 255, 0, 0.2);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.small-logo {
    width: 120px;
    height: auto;
    margin-right: 15px;
    filter: hue-rotate(140deg) brightness(1.5) drop-shadow(0 0 5px rgba(50, 50, 50, 0.9));
}

header h1 {
    font-size: 24px;
    color: var(--primary-color);
    text-shadow: var(--matrix-glow);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.user-info {
    display: flex;
    align-items: center;
}

#user-name {
    margin-right: 15px;
    font-weight: 500;
    color: var(--primary-color);
    text-shadow: var(--matrix-glow);
}

.btn-small {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 0;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-small:hover {
    background-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.btn-blue {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-blue:hover {
    background-color: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.btn-green {
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.btn-green:hover {
    background-color: rgba(0, 255, 50, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 50, 0.5);
}

.btn-orange {
    color: #fd7e14;
    border: 1px solid #fd7e14;
}

.btn-orange:hover {
    background-color: rgba(253, 126, 20, 0.2);
    box-shadow: 0 0 10px rgba(253, 126, 20, 0.5);
}

main {
    padding: 30px;
    flex-grow: 1;
}

.services-container {
    background-color: rgba(0, 10, 0, 0.8);
    border: var(--matrix-border);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 255, 0, 0.2), 0 0 10px rgba(0, 255, 0, 0.7);
    padding: 25px;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.services-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)),
                repeating-linear-gradient(transparent, transparent 2px, rgba(0, 20, 0, 0.5) 2px, rgba(0, 20, 0, 0.5) 4px);
    pointer-events: none;
    z-index: -1;
}

.services-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: var(--matrix-border);
    padding-bottom: 10px;
}

.services-header h2 {
    margin: 0;
    color: var(--primary-color);
    text-shadow: var(--matrix-glow);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.services-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    background-color: transparent;
    color: var(--primary-color);
    border: var(--matrix-border);
    border-radius: 0;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-action:hover {
    background-color: rgba(0, 255, 0, 0.2);
    box-shadow: var(--matrix-glow);
}

#add-container-btn {
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

#add-container-btn:hover {
    background-color: rgba(0, 255, 50, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 50, 0.5);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.service-card {
    background-color: rgba(0, 15, 0, 0.9);
    border: var(--matrix-border);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 255, 0, 0.2), 0 0 10px rgba(0, 255, 0, 0.7);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    transform: translateZ(0);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.service-card:hover {
    transform: translateY(-5px) translateZ(10px);
    box-shadow: 0 12px 24px rgba(0, 255, 0, 0.3), 0 0 20px rgba(0, 255, 0, 0.7);
}

.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)),
                repeating-linear-gradient(transparent, transparent 2px, rgba(0, 20, 0, 0.3) 2px, rgba(0, 20, 0, 0.3) 4px);
    pointer-events: none;
    z-index: -1;
}

.service-header {
    padding: 15px;
    background-color: rgba(0, 70, 0, 0.8);
    border-bottom: var(--matrix-border);
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-name {
    font-size: 18px;
    font-weight: 700;
    text-shadow: var(--matrix-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.service-status {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid;
    background-color: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.status-running {
    border-color: var(--success-color);
    color: var(--success-color);
    box-shadow: 0 0 5px rgba(0, 255, 50, 0.7);
}

.status-stopped {
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.7);
}

.service-body {
    padding: 20px;
    background-color: rgba(0, 10, 0, 0.7);
}

.service-description {
    color: #FFFFFF;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    padding: 10px;
    background-color: rgba(0, 30, 0, 0.6);
    border-left: 3px solid var(--primary-color);
}

.service-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    padding: 8px 5px;
    background-color: rgba(0, 20, 0, 0.5);
}

.service-info span:first-child {
    font-weight: 700;
    color: var(--accent-color);
    width: 80px;
}

.service-info span:last-child {
    color: #FFFFFF;
    text-align: right;
    font-weight: 500;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.service-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    background-color: rgba(0, 40, 0, 0.6);
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.action-btn {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.action-btn:first-child {
    border-right: 1px solid rgba(0, 255, 0, 0.5);
}

.btn-start {
    color: var(--success-color);
    text-shadow: 0 0 8px rgba(0, 255, 50, 0.7);
}

.btn-stop {
    color: var(--danger-color);
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.7);
}

.btn-open {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.7);
}

.action-btn:hover {
    background-color: rgba(0, 40, 0, 0.8);
}

.service-update {
    text-align: center;
    margin-top: 15px;
    border-top: 2px solid rgba(0, 255, 0, 0.3);
    padding-top: 15px;
}

.update-btn, .restore-btn {
    background-color: rgba(0, 20, 0, 0.7);
    border-radius: 0;
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.update-btn {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    text-shadow: var(--matrix-glow);
}

.update-btn:hover {
    background-color: rgba(0, 255, 0, 0.3);
    box-shadow: var(--matrix-glow);
}

.restore-btn {
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.7);
}

.restore-btn:hover {
    background-color: rgba(255, 204, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.7);
}

.service-remove {
    text-align: center;
    margin-top: 15px;
    border-top: 2px solid rgba(0, 255, 0, 0.3);
    padding-top: 15px;
}

.remove-btn {
    background-color: rgba(20, 0, 0, 0.7);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: 0;
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.7);
    font-weight: bold;
}

.remove-btn:hover {
    background-color: rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

footer {
    background-color: rgba(0, 10, 0, 0.9);
    border-top: var(--matrix-border);
    text-align: center;
    padding: 15px;
    color: var(--primary-color);
    font-size: 14px;
    box-shadow: 0 -2px 10px rgba(0, 255, 0, 0.2);
    opacity: 0.8;
    letter-spacing: 1px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: rgba(0, 10, 0, 0.9);
    border: var(--matrix-border);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 255, 0, 0.2), 0 0 10px rgba(0, 255, 0, 0.7);
    padding: 30px;
    width: 500px;
    max-width: 90%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateZ(0);
    transform-style: preserve-3d;
}

.modal-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)),
                repeating-linear-gradient(transparent, transparent 2px, rgba(0, 20, 0, 0.5) 2px, rgba(0, 20, 0, 0.5) 4px);
    pointer-events: none;
    z-index: -1;
}

/* Tab Styles */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: var(--matrix-border);
}

.tab-btn {
    padding: 10px 20px;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    flex: 1;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab-btn.active {
    background-color: rgba(0, 255, 0, 0.1);
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    text-shadow: var(--matrix-glow);
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* System Containers List */
.system-containers-list {
    max-height: 300px;
    overflow-y: auto;
    border: var(--matrix-border);
    border-radius: 0;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
}

.system-container-item {
    padding: 10px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.system-container-item:last-child {
    border-bottom: none;
}

.system-container-info {
    flex: 1;
}

.system-container-name {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--primary-color);
    text-shadow: var(--matrix-glow);
}

.system-container-details {
    font-size: 12px;
    color: var(--accent-color);
}

.add-to-dashboard-btn {
    background-color: transparent;
    color: var(--success-color);
    border: 1px solid var(--success-color);
    border-radius: 0;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.add-to-dashboard-btn:hover {
    background-color: rgba(0, 255, 50, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 50, 0.5);
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: var(--primary-color);
}

.no-containers-message {
    text-align: center;
    padding: 20px;
    color: var(--primary-color);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.3s;
    text-shadow: var(--matrix-glow);
}

.close-modal:hover {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
    text-shadow: var(--matrix-glow);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal .input-group {
    margin-bottom: 15px;
}

.modal select {
    width: 100%;
    padding: 12px;
    border: var(--matrix-border);
    border-radius: 0;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--primary-color);
    margin-bottom: 15px;
    box-shadow: inset 0 0 5px rgba(0, 255, 0, 0.2);
}

.modal select:focus {
    outline: none;
    box-shadow: 0 0 10px var(--primary-color);
}

.modal select option {
    background-color: rgba(0, 10, 0, 0.9);
    color: var(--primary-color);
}

/* Update Container Modal */
.container-info {
    background-color: rgba(0, 20, 0, 0.5);
    border: var(--matrix-border);
    padding: 15px;
    border-radius: 0;
    margin-bottom: 20px;
}

.container-info p {
    margin: 5px 0;
    color: var(--primary-color);
}

.container-info p strong {
    color: var(--accent-color);
    margin-right: 10px;
}

.progress-container {
    width: 100%;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border: var(--matrix-border);
    border-radius: 0;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Metrics Styles */
.service-metrics {
    margin: 15px 0;
    padding: 10px;
    background-color: rgba(0, 20, 0, 0.6);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
}

.metrics-loading {
    text-align: center;
    padding: 10px;
    color: var(--accent-color);
    font-size: 14px;
    animation: pulse 1.5s infinite;
}

.metrics-placeholder {
    text-align: center;
    padding: 10px;
    color: rgba(0, 255, 0, 0.5);
    font-size: 12px;
    font-style: italic;
}

.metrics-unavailable {
    text-align: center;
    padding: 10px;
    color: var(--warning-color);
    font-size: 14px;
}

.metric {
    margin-bottom: 12px;
}

.metric:last-child {
    margin-bottom: 0;
}

.metric-name {
    display: inline-block;
    width: 80px;
    color: var(--accent-color);
    font-weight: 500;
}

.metric-value {
    color: var(--primary-color);
    font-weight: 500;
    text-shadow: var(--matrix-glow);
}

.metric-bar {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: width 0.5s ease-in-out;
    box-shadow: 0 0 5px var(--primary-color);
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}
