/* Modern IoT Dashboard Design */

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3ZBw1xU1rKptJj_0jans920.woff2) format('woff2');
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f97316;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #1e293b;
    --darker-bg: #0f172a;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body,
html {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

.main-content {
    display: flex;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 2rem auto;
    gap: 2rem;
    padding: 0 1rem;
}

nav {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    min-width: 240px;
    max-width: 280px;
    height: fit-content;
    position: sticky;
    top: 100px;
    transition: all 0.3s ease;
}

nav h2 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

nav h2:first-child {
    margin-top: 0;
}

nav h2 a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.125rem;
    transition: color 0.3s ease;
}

nav h2 a:hover {
    color: var(--primary-hover);
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    margin: 0.25rem 0;
}

nav ul a {
    display: block;
    padding: 0.625rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav ul a:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

article {
    flex: 1;
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    min-height: 500px;
}

article h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

article h2:first-child {
    margin-top: 0;
}

article p {
    margin: 1rem 0;
    color: var(--text-secondary);
}

article code {
    background: var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
}

.center {
    margin: 0;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

table {
    border-spacing: 0;
    margin: 1.5rem 0;
    padding: 0;
}

img.rounded {
    border-radius: 20px;
}

.centered {
    text-align: center;
    margin: 2rem 0;
}

.status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.up {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.status-badge.down {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.status-badge.stable {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.info-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
}

.info-card p {
    color: white;
    margin: 0.5rem 0;
}

.info-card code {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 700;
}


/* for d3.js pages */

.area {
    clip-path: url(#clip);
    fill: none;
    stroke: steelblue;
    stroke-width: 2;
}

.axis {
    font-family: Open Sans, Tahoma, Verdana, sans-serif;
    /* font-size: 10pt; */
}

.zoom {
    cursor: move;
    fill: none;
    pointer-events: all;
}


/* Grid for graphs */

.sparkline {
    fill: none;
    stroke: #000;
    stroke-width: 0.5px;
}

.grid line {
    shape-rendering: crispEdges;
    stroke: lightgrey;
    stroke-opacity: 0.7;
}

.grid path {
    stroke-width: 0;
}

#pages {
    font-family: 'Open Sans', sans-serif;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
}

#pages td,
#pages th {
    border: none;
    padding: 1rem;
    text-align: left;
}

#pages th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

#pages tbody tr {
    background-color: white;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

#pages tbody tr:last-child {
    border-bottom: none;
}

#pages tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

#pages tbody tr:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

#pages a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

#pages a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Responsive Mobile Menu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 1000;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 30px -5px rgba(0, 0, 0, 0.3);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 968px) {
    .main-content {
        flex-direction: column;
        padding: 0 0.5rem;
        margin: 1rem auto;
    }

    nav {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        max-width: 80vw;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    nav.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .mobile-overlay.active {
        display: block;
    }

    header h1 {
        font-size: 1.5rem;
    }

    article {
        padding: 1.5rem;
    }

    #pages {
        font-size: 0.875rem;
    }

    #pages td,
    #pages th {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 640px) {
    header {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    article {
        padding: 1rem;
        border-radius: 0.5rem;
    }

    article h2 {
        font-size: 1.25rem;
    }

    #pages {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #pages table {
        min-width: 600px;
    }

    .info-card {
        padding: 1rem;
    }
}

