/* =========================
   Color Variables
   ========================= */
:root {
    --primary-green: #00684A;
    --secondary-green: #00ED64;
    --dark-text: #001E2B;
    --page-background: #FFFFFF;
    --failure-red: #FF0000;
}

/* =========================
   Base Layout
   ========================= */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--page-background);
    color: var(--dark-text);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1 {
    color: var(--dark-text);
    font-weight: 600;
}

/* =========================
   Controls
   ========================= */
.controls {
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.controls button {
    padding: 10px 18px;
    border: 1px solid var(--primary-green);
    background-color: var(--page-background);
    color: var(--primary-green);
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.controls button:hover,
.controls button.active {
    background-color: var(--primary-green);
    color: var(--page-background);
}

/* =========================
   Visualization Container
   ========================= */
#visualization-container {
    width: 400px;
    height: 400px;
    position: relative;
    margin: 20px auto;
}

/* =========================
   Status Text
   ========================= */
#status-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-green);
    margin-top: 20px;
    transition: color 0.3s ease;
}

/* =========================
   Footer
   ========================= */
footer {
    position: absolute;
    bottom: 20px;
    text-align: center;
    width: 100%;
    color: #aaa;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

footer a {
    color: #aaa;
    display: inline-block;
    width: 24px;
    height: 24px;
    transition: color 0.2s ease-in-out;
}

footer a:hover {
    color: var(--dark-text);
}

footer svg {
    width: 100%;
    height: 100%;
}

/* =========================
   Node Styling
   ========================= */
.node {
    position: absolute;
    width: 100px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transform: translate(-50%, -50%);
}

.node .icon-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 70px;
}

.node .icon-container svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.node .failure-x {
    color: var(--failure-red);
    font-weight: bold;
    display: none;
    z-index: 2;
}

.node.failed .db-icon {
    opacity: 0.3;
}

.node.failed .failure-x {
    display: block;
}

.node .label {
    margin-top: 5px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.node .label.primary {
    color: var(--primary-green);
}

.node .label.secondary {
    color: var(--secondary-green);
}

.db-icon {
    width: 75px;
    height: 75px;
    display: block;
    margin: 0 auto;
}

/* =========================
   Layout Helpers
   ========================= */
.dotted-divider-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 32px;
}

.dotted-divider {
    border-top: 2px dotted #bbb;
    width: 80%;
    height: 0;
}

.region-row {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    margin: 0;
    width: 100%;
    overflow: hidden;
}
