:root {
    --primary-color: #1a73e8;
    --background-color: #f8f9fa;
    --sidebar-bg: #ffffff;
    --text-color: #202124;
    --border-color: #dadce0;
    --card-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

body {
    font-family: 'Google Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    font-size: 13px;
    /* GCloud default is usually smaller/compact */
}

.container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.logo {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--text-color);
    padding-left: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 5px;
}

.sidebar a {
    text-decoration: none;
    color: #5f6368;
    display: block;
    padding: 10px 15px;
    border-radius: 0 20px 20px 0;
    font-weight: 400;
    transition: background-color 0.2s;
    font-size: 13px;
}

.sidebar a:hover {
    background-color: #f1f3f4;
    color: var(--text-color);
}

.sidebar a.active {
    background-color: #e8f0fe;
    color: var(--primary-color);
}

.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

h1 {
    font-weight: 400;
    font-size: 18px;
    /* Matched to .logo */
    margin-bottom: 20px;
}

h2 {
    font-size: 13px;
    font-weight: 400;
    color: #5f6368;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Card Styling */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

/* Stoplight */
.stoplight {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #dadce0;
    margin: 0 auto;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 168, 83, 0.7);
    }

    70% {
        box-shadow: 0 0 20px 10px rgba(52, 168, 83, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 168, 83, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(234, 67, 53, 0.7);
    }

    70% {
        box-shadow: 0 0 20px 10px rgba(234, 67, 53, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(234, 67, 53, 0);
    }
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 188, 4, 0.7);
    }

    70% {
        box-shadow: 0 0 20px 10px rgba(251, 188, 4, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(251, 188, 4, 0);
    }
}

.stoplight.green {
    background-color: #34a853;
    box-shadow: 0 0 8px 1px rgba(52, 168, 83, 0.6);
    animation: pulse-green 2s infinite;
}

.stoplight.red {
    background-color: #ea4335;
    box-shadow: 0 0 8px 1px rgba(234, 67, 53, 0.6);
    animation: pulse-red 2s infinite;
}

.stoplight.yellow,
.stoplight-small.yellow {
    background-color: #fbbc04;
    box-shadow: 0 0 8px 1px rgba(251, 188, 4, 0.6);
    animation: pulse-yellow 2s infinite;
}

/* Small Stoplight for Sidebar */
.stoplight-small {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dadce0;
    display: inline-block;
}

.stoplight-small.green {
    background-color: #34a853;
    box-shadow: 0 0 5px 1px rgba(52, 168, 83, 0.6);
    animation: pulse-green 2s infinite;
}

.stoplight-small.red {
    background-color: #ea4335;
    box-shadow: 0 0 5px 1px rgba(234, 67, 53, 0.6);
    animation: pulse-red 2s infinite;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 400;
    color: var(--primary-color);
}

.stat-label {
    font-size: 13px;
    color: #5f6368;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    background-color: var(--background-color);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    text-align: center;
    width: 300px;
}

.login-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
}

.login-btn:hover {
    background-color: #1669bb;
    box-shadow: 0 1px 3px 1px rgba(60, 64, 67, 0.3);
}

/* Google Cloud Console Style Buttons */
.btn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
    height: 36px;
    box-sizing: border-box;
}

.btn:hover {
    background-color: #f1f3f4;
    /* Slightly gray */
    color: #174ea6;
    /* Darker blue */
    box-shadow: 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    /* Stand out */
    text-decoration: none;
}

.btn:active {
    background-color: #e8eaed;
    box-shadow: inset 0 1px 2px rgba(60, 64, 67, 0.3);
}

.btn:disabled {
    background-color: #f1f3f4;
    color: #dadce0;
    border-color: #e8eaed;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn:disabled:hover {
    background-color: #f1f3f4;
    color: #dadce0;
    box-shadow: none;
}

/* Specific variants if needed */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #174ea6;
    box-shadow: 0 1px 3px 1px rgba(60, 64, 67, 0.3);
    color: white;
}

/* Log Table Styles */
.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8f9fa;
    color: #5f6368;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1;
    /* Ensure header stays above scrolled content */
}

tr:last-child td {
    border-bottom: none;
    /* Remove border from last row */
}

/* Column Widths */
.col-timestamp {
    width: 150px;
    white-space: nowrap;
}

.col-level {
    width: 60px;
    white-space: nowrap;
}

.col-message {
    width: auto;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Simple variation for log levels if desired, e.g. distinct colors */
.log-level-INFO {
    color: #1a73e8;
}

.log-level-WARN {
    color: #ea4335;
}

.log-level-DEBUG {
    color: #34a853;
}

/* Settings Page Styles */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-item label {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 400;
}

.setting-value {
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
}

/* Stocks Table Column Widths */
.col-stock-id {
    width: 80px;
    white-space: nowrap;
}

.col-stock-name {
    width: auto;
}

.col-stock-isin {
    width: 150px;
    white-space: nowrap;
}

.col-stock-enabled {
    width: 100px;
    white-space: nowrap;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    box-shadow: var(--card-shadow);
    align-items: center;
    gap: 16px;
}

.mobile-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-color);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    background-color: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background-color: #f1f3f4;
    border-radius: 4px;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

/* Responsive Design */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .content {
        padding: 20px;
    }
}

@media screen and (max-width: 768px) {
    body {
        display: block;
    }

    .container {
        display: block;
        width: 100%;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        display: none;
        position: fixed !important;
        top: 0;
        left: 0;
        width: 250px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        border-right: 1px solid var(--border-color);
    }

    .sidebar.open {
        display: flex;
        left: 0;
    }

    .content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 70px 15px 15px 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .card {
        padding: 15px;
    }

    h1 {
        font-size: 16px;
    }

    .table-container {
        max-height: 300px;
    }

    th,
    td {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .content {
        padding: 60px 10px 10px 10px;
    }

    .card {
        padding: 12px;
        margin-bottom: 15px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 12px;
    }

    h1 {
        font-size: 14px;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 12px;
    }

    .login-box {
        width: 90%;
        padding: 30px 20px;
    }

    /* Make tables more mobile-friendly */
    .col-timestamp {
        width: 100px;
        font-size: 11px;
    }

    .col-level {
        width: 50px;
    }

    .col-message {
        font-size: 11px;
    }

    /* Settings page adjustments */
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .setting-item label,
    .setting-value {
        font-size: 13px;
    }
}

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

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

@media screen and (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* Settings page responsive layout */
.settings-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.settings-column {
    flex: 1;
}

@media screen and (max-width: 768px) {
    .settings-layout {
        flex-direction: column;
        gap: 15px;
    }

    .settings-column {
        width: 100%;
    }
}