/* ===== Variables ===== */
:root {
    --foreground-rgb: rgb(200, 200, 200);
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;
    --active-link-color: rgb(255, 255, 255);
    --custom-font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
        Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
    --custom-bg-color: #101010;
    --custom-panel-color: #222;
    --custom-box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.8);
    --custom-color-brand: #4a3aff;
    --custom-color-brand-hover: #1982fc;
    --custom-color-secondary: #d5d5d5;
    --custom-border: 1px solid #333;
    --custom-border-radius: 5px;
    --custom-spacing: 5px;
    font-size: 14px;
    font-weight: 200;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    color: var(--foreground-rgb);
    font-family: var(--custom-font-family);
    background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-width: 1280px;
    margin: 0 auto;
    color: rgb(200, 200, 200);
}

main {
    flex: 1;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color .25s;
    text-shadow: 0 0 3px #fff;
}

a:hover {
    text-shadow: 0 0 6px #fff, 0 0 15px #fff;
}

/* ===== Header ===== */
header {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    align-items: center;
    padding: 4px 0;
    margin-bottom: 12px;
}

.header-left h1 {
    font-size: 2rem;
    font-weight: 200;
}

/* ===== Navigation ===== */
.navigation ul {
    display: flex;
    list-style: none;
    gap: 0;
}

.navigation li {
    padding: 8px 10px;
}

.navigation .active {
    color: white;
    text-shadow: 0 0 4px #fff, 0 0 8px #fff, 0 0 15px #fff;
}

/* ===== User Info ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    font-size: 0.85rem;
    color: rgb(156, 163, 175);
}

.sign-out-btn {
    background: none;
    border: none;
    color: rgb(156, 163, 175);
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.sign-out-btn:hover {
    color: white;
}

.inline {
    display: inline;
}

/* ===== Footer ===== */
footer {
    display: flex;
    height: 64px;
    border-top: 1px solid rgb(82, 82, 82);
    margin-top: auto;
    padding-top: 16px;
}

.footer-text {
    text-align: right;
    margin: auto 0 auto auto;
}

/* ===== Forms ===== */
label {
    display: block;
    margin: 1rem 0 0.3rem 0;
    color: var(--custom-color-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

input, select {
    width: 100%;
    border-radius: 5px;
    border: var(--custom-border);
    padding: 8px;
    font-size: 0.9rem;
    background-color: var(--custom-bg-color);
    color: rgb(200, 200, 200);
}

input::placeholder {
    color: rgb(120, 120, 120);
}

textarea {
    width: 100%;
    height: 100px;
    border-radius: 5px;
    border: var(--custom-border);
    padding: 8px;
    font-size: 0.9rem;
    background-color: var(--custom-bg-color);
    color: rgb(200, 200, 200);
}

input[disabled] {
    color: var(--custom-color-secondary);
}

input[type=submit] {
    width: 150px;
    margin: 1.5rem auto;
    display: block;
    cursor: pointer;
}

input[type=submit][disabled],
button:disabled,
button[disabled],
button:hover:disabled,
button[disabled]:hover {
    background-color: #555;
    cursor: not-allowed;
}

.search-input {
    margin: 10px 0;
}

/* ===== Buttons ===== */
.button-primary {
    display: inline-block;
    text-align: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-radius: 5px;
    border: 1px solid #444;
    margin: 1rem 0 2rem 0;
    text-shadow: 0 0 16px #fff, 0 0 26px #fff;
    transition: background-color 0.3s;
    background: transparent;
    color: inherit;
}

.button-primary:hover:not(:disabled) {
    text-shadow: 0 0 6px #fff, 0 0 15px #fff, 0 0 25px #fff;
}

.button-inline {
    display: inline-block;
    text-align: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-radius: 5px;
    border: 1px solid #444;
    margin: 0 0 0 10px;
    text-shadow: 0 0 16px #fff, 0 0 26px #fff;
    transition: background-color 0.3s;
    background: transparent;
    color: inherit;
}

.button-right {
    display: inline-block;
    text-align: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-radius: 5px;
    text-shadow: 0 0 16px #fff, 0 0 26px #fff;
    transition: background-color 0.3s;
    float: right;
    margin: 20px;
    background: transparent;
    color: inherit;
    border: 1px solid #444;
}

/* ===== Error / Message ===== */
.error {
    color: orangered;
    margin: 3px 0;
}

.message {
    color: green;
    margin: 3px 0;
}

/* ===== Login ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    width: 100%;
    max-width: 28rem;
}

.login-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 200;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: var(--custom-border);
    border-radius: var(--custom-border-radius);
    background: transparent;
    color: var(--foreground-rgb);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-shadow: none;
}

.google-btn:hover {
    background: #1a1a2e;
    border-color: #555;
    color: #fff;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.2rem 0;
    color: #666;
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #333;
}

.login-divider span {
    padding: 0 12px;
}

/* ===== Summary Cards ===== */
.summary-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.summary-card {
    border: var(--custom-border);
    border-radius: var(--custom-border-radius);
    padding: 12px 20px;
    min-width: 100px;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--custom-color-secondary);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.5rem;
}

.text-green { color: #52c41a; }
.text-yellow { color: #faad14; }
.text-red { color: #ff4d4f; }

/* ===== Cost Controls ===== */
.costs-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 10px 0;
}

.costs-controls .search-input {
    flex: 1;
    margin: 0;
}

.window-select {
    width: auto;
    min-width: 160px;
}

.text-right {
    text-align: right;
}

.cost-total {
    font-weight: 400;
}

/* ===== Data Tables ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #333;
}

.data-table th {
    color: var(--custom-color-secondary);
    font-weight: 400;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.empty-row {
    text-align: center;
    color: #888;
    padding: 24px;
}

/* ===== Tags / Badges ===== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 400;
}

.tag-green { background-color: rgba(82, 196, 26, 0.2); color: #52c41a; }
.tag-red { background-color: rgba(255, 77, 79, 0.2); color: #ff4d4f; }
.tag-gold { background-color: rgba(250, 173, 20, 0.2); color: #faad14; }
.tag-default { background-color: rgba(255, 255, 255, 0.1); color: #999; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.75rem;
    padding: 0 6px;
}

.badge-green { background-color: #52c41a; color: white; }
.badge-red { background-color: #ff4d4f; color: white; }

/* ===== Pods ===== */
.pods-container {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pod-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ===== Grid Layout ===== */
.gridContainer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.gridItem {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.gridItem p {
    margin-bottom: 15px;
    margin-top: 15px;
}

.gridItem h2 {
    margin-top: 0;
}

.gridItem a {
    color: #ffffff;
    text-decoration: none;
}

.gridItem a:hover {
    text-decoration: underline;
}

/* ===== Tabs ===== */
.tab-buttons {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

/* ===== Editable Fields ===== */
.editable-field .edit-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.editable-field:hover .edit-btn {
    opacity: 1;
}

.field-value {
    display: inline;
}

.inline-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mono-value {
    width: 100%;
    font-family: monospace;
    font-size: 12px;
    white-space: pre;
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===== Notification ===== */
.notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #c3cdc6;
    color: #252725;
    padding: 10px 20px;
    border: 1px solid #e5f5c6;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.notification button {
    background: none;
    border: none;
    color: #0d270a;
    font-weight: bold;
    cursor: pointer;
    margin-left: 20px;
}

/* ===== Loader ===== */
.loader-small {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #acb3b8;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Dot Loader ===== */
.dot-loader span {
    animation: dotPulse 1.5s infinite;
    font-size: 2rem;
}

.dot-loader span:nth-child(2) {
    animation-delay: 0.3s;
}

.dot-loader span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

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

.modal-content {
    background: #1a1a1a;
    border: var(--custom-border);
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    z-index: 9999;
}

.modal-content h2 {
    margin-bottom: 16px;
    font-weight: 300;
}

.modal-content p {
    margin-bottom: 16px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.pagination button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ===== Meta text ===== */
.meta-text {
    color: #888;
    font-size: 12px;
    margin-top: 8px;
}

/* ===== Logs ===== */
#logs ul {
    list-style: none;
}

#logs li {
    margin-bottom: 8px;
}

/* ===== Error Logs ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.select-input {
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9rem;
}
.mono-text {
    font-family: monospace;
    font-size: 0.75rem;
}
.log-message-cell {
    max-width: 600px;
    cursor: pointer;
}
.log-message-short {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.log-message-full {
    display: none;
    margin: 8px 0 0;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow: auto;
}
.log-row.expanded .log-message-short {
    display: none;
}
.log-row.expanded .log-message-full {
    display: block;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    header {
        grid-template-columns: 1fr auto;
    }
    .navigation {
        display: none;
    }
    .summary-cards {
        flex-wrap: wrap;
    }
    .data-table {
        font-size: 0.8rem;
    }
}
