:root {
    /* Base surfaces */
    --bg-color: #0d2317;                        /* Deep Forest Pine */
    --card-bg: rgba(24, 56, 36, 0.85);          /* Woodland Moss surface */
    --border-color: rgba(212, 197, 185, 0.28);   /* Warm Sandstone boundary (3:1+ contrast) */
    --border-focus: #86efac;                    /* Bright focus ring */

    /* Typography & Content Colors */
    --text-color: #f7fee7;                      /* Ivory Cream (12.4:1 contrast - AAA) */
    --text-secondary: #d4c5b9;                 /* Warm Sandstone Tan (7.7:1 contrast - AAA) */
    --text-muted: #b5a89b;                     /* Warm Clay Tan for meta & timestamps (5.5:1 contrast - AA) */
    
    /* Accents & Status Indicators */
    --accent-color: #4ade80;                    /* Vibrant Leaf Green */
    --accent-light: #86efac;                    /* Bright Mint for links & labels (9.2:1 contrast - AAA) */
    --accent-glow: rgba(74, 222, 128, 0.35);
    
    --status-online: #86efac;                   /* Clear Spring Mint (9.2:1 contrast - AAA) */
    --status-degraded: #fde047;                 /* Goldenrod Amber (9.8:1 contrast - AAA) */
    --status-offline: #fecaca;                  /* Coral Rose (8.9:1 contrast - AAA) */

    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.background-glob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    opacity: 0.25;
    z-index: -1;
    animation: pulse 10s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.25;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.35;
    }
}

.container {
    width: 100%;
    max-width: 1000px;
    height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: hidden;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

#appContainer {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1.5rem;
    overflow: hidden;
}

header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #ffffff 0%, #86efac 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

input[type="text"] {
    width: 100%;
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    font-size: 1.25rem;
    color: var(--text-color);
    font-family: var(--font-main);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

input[type="text"]::placeholder {
    color: #a8a29e;
    opacity: 0.9;
}

input[type="text"]:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
    transform: translateY(-2px);
}

.results-container {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    animation: fadeInUp 0.5s ease-out;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.results-container.hidden {
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.source-badge {
    background: rgba(134, 239, 172, 0.2);
    color: var(--accent-light);
    border: 1px solid rgba(134, 239, 172, 0.35);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.timestamp {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.content {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.status-message {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: right;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

th {
    color: #e2d9cf;
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-color);
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.status-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    font-size: 0.875rem;
    font-weight: 600;
}

.status-indicator.online {
    color: var(--status-online);
}

.status-indicator.degraded {
    color: var(--status-degraded);
}

.status-indicator.offline {
    color: var(--status-offline);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Styles */
.auth-container {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 3rem;
    backdrop-filter: blur(12px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    animation: fadeInUp 0.5s ease-out;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 0.3rem;
    gap: 0.35rem;
    width: 100%;
    max-width: 360px;
    margin-bottom: 0.5rem;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.55rem 0.75rem;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.auth-tab-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.06);
}

.auth-tab-btn.active {
    background: rgba(24, 56, 36, 0.95);
    color: var(--accent-light);
    font-weight: 600;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.auth-tab-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

.google-icon {
    flex-shrink: 0;
}

.auth-instruction {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.auth-btn {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-btn:hover {
    background: #f3f4f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.auth-error-msg {
    background: rgba(127, 29, 29, 0.45);
    border: 1px solid rgba(254, 202, 202, 0.5);
    color: #fee2e2;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
    width: 100%;
    max-width: 340px;
    animation: fadeInDown 0.3s ease-out;
}

.alt-login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 340px;
}

.alt-login-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-color);
    font-family: var(--font-main);
    outline: none;
    transition: all 0.2s;
    text-align: center;
}

.alt-login-input::placeholder {
    color: #a8a29e;
    opacity: 0.9;
}

.alt-login-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

.local-auth-btn {
    background: var(--accent-color);
    color: #052e16;
    font-weight: 600;
    justify-content: center;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
}

.local-auth-btn:hover {
    background: #86efac;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.45);
}

.alt-sublink {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.alt-sublink a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.alt-sublink a:hover {
    color: #ffffff;
}

.hidden {
    display: none !important;
}

.user-info-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    animation: fadeInDown 0.5s ease-out;
}

#userName {
    color: var(--accent-light);
    font-weight: 600;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notify-btn {
    background: rgba(134, 239, 172, 0.12);
    border: 1.5px solid var(--border-color);
    color: var(--accent-light);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
}

.notify-btn:hover {
    background: rgba(134, 239, 172, 0.22);
    border-color: var(--accent-light);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.25);
}

.notify-btn.active {
    background: rgba(74, 222, 128, 0.28);
    border-color: var(--accent-light);
    color: #ffffff;
}

.sign-out-btn {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.sign-out-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: #ffffff;
}

.status-error {
    color: var(--status-offline);
    font-weight: 700;
}

.status-ok {
    color: var(--status-online);
    font-weight: 700;
}

/* Static Landing Link List */
.link-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    text-align: left;
    width: 100%;
    max-width: 600px;
    font-size: 1rem;
    color: var(--text-color);
}

.link-list li {
    line-height: 1.5;
}

.link-label {
    color: var(--accent-light);
    font-weight: 600;
}

.link-list a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s, text-shadow 0.2s;
}

.link-list a:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(134, 239, 172, 0.6);
}

.link-separator {
    color: #a8a29e;
    margin: 0 0.25rem;
}

/* Upload Form Styles */
.upload-form-container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: left;
}

.upload-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.upload-form-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.upload-form-row .flex-1 {
    flex: 1;
}

.upload-form-row .flex-2 {
    flex: 2;
}

.upload-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.upload-file-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.upload-file-wrapper:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.upload-file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.upload-file-btn {
    background: rgba(134, 239, 172, 0.18);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-block;
}

.upload-file-btn:hover {
    background: rgba(134, 239, 172, 0.3);
    border-color: var(--accent-light);
    color: #ffffff;
}

.upload-filename-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-filename-text.selected {
    color: var(--accent-light);
    font-weight: 500;
}

.upload-select,
.upload-text-input,
.upload-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    color: var(--text-color);
    font-family: var(--font-main);
    outline: none;
    transition: all 0.2s ease;
}

.upload-select option {
    background: #143623;
    color: var(--text-color);
}

.upload-select:focus,
.upload-text-input:focus,
.upload-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.upload-textarea {
    resize: vertical;
    min-height: 70px;
}

.upload-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.upload-submit-btn {
    background: var(--accent-color);
    color: #052e16;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.upload-submit-btn:hover {
    background: #86efac;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
    transform: translateY(-1px);
}

.upload-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    animation: fadeInUp 1s ease-out;
}