/* ========================================
   KENNY STATUS - Discord Status Page Clone
   ======================================== */

/* CSS Variables */
:root {
    --header-bg: #55645F;
    --body-bg: #f6f8fa;
    --white: #ffffff;
    --text-primary: #2e3338;
    --text-secondary: #747f8d;
    --text-dark: #060607;

    --green: #43b581;
    --green-light: #e6f5ef;
    --yellow: #faa61a;
    --orange: #f26522;
    --red: #f04747;
    --blue: #00b0f4;
    --gray: #747f8d;

    --border-color: #e3e5e8;
    --border-light: #ebedef;

    --font-primary: "Whitney", "Helvetica Neue", Helvetica, Arial, sans-serif;

    --container-width: 800px;
    --header-height: 80px;

    --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.05);
    --radius: 3px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.4;
    min-height: 100vh;
}

a {
    color: var(--header-bg);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Page Layout */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================
   HEADER
   ================== */
.header {
    background-color: var(--header-bg);
    padding: 0;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--header-height);
    padding: 0 20px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    color: var(--white);
    font-weight: 700;
}

.logo:hover {
    text-decoration: none;
}

.logo-icon {
    width: 140px;
    height: auto;
}

.subscribe-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    color: var(--white);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subscribe-btn:hover {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ==================
   MAIN CONTENT
   ================== */
.main-content {
    flex: 1;
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ==================
   STATUS BANNER
   ================== */
.status-banner {
    background-color: var(--green);
    border-radius: var(--radius);
    padding: 24px 30px;
    margin-bottom: 40px;
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.status-banner.degraded { background-color: var(--yellow); }
.status-banner.partial { background-color: var(--orange); }
.status-banner.major { background-color: var(--red); }
.status-banner.maintenance { background-color: var(--gray); }

.status-text {
    font-size: 20px;
    font-weight: 500;
}

/* ==================
   COMPONENTS SECTION
   ================== */
.components-section {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    overflow: hidden;
}

.components-list {
    display: flex;
    flex-direction: column;
}

.component-item {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-light);
}

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

.component-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.component-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

.status-label {
    font-size: 14px;
    color: var(--green);
    font-weight: 500;
}

.status-label.degraded { color: var(--yellow); }
.status-label.partial { color: var(--orange); }
.status-label.major { color: var(--red); }

/* Uptime bars */
.uptime-bar-container {
    display: flex;
    gap: 2px;
    height: 34px;
}

.uptime-bar {
    flex: 1;
    height: 100%;
    background-color: var(--green);
    border-radius: 1px;
    position: relative;
    cursor: help;
}

.uptime-bar:hover { opacity: 0.7; }
.uptime-bar.degraded { background-color: var(--yellow); }
.uptime-bar.partial { background-color: var(--orange); }
.uptime-bar.major { background-color: var(--red); }
.uptime-bar.empty { 
    background-color: #e8e8e8;
    border: 1px solid #d0d0d0;
}

.uptime-bar-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e2124;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.uptime-bar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e2124;
}

.uptime-bar:hover .uptime-bar-tooltip {
    display: block;
}

.uptime-summary {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    padding-top: 8px;
}

/* ==================
   PAST INCIDENTS
   ================== */
.uptime-section {
    margin-bottom: 20px;
}

.uptime-header > span {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-dark);
}

.incident-day {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.incident-date {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.no-incidents {
    color: var(--text-secondary);
    font-size: 14px;
}

.incident-card {
    padding: 15px 0;
}

.incident-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 10px;
    display: block;
}

.incident-title.resolved {
    color: var(--text-dark);
}

.incident-updates {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.incident-update {
    padding-left: 20px;
    border-left: 2px solid var(--border-light);
}

.incident-update-status {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.incident-update-status.resolved { color: var(--green); }
.incident-update-status.investigating { color: var(--yellow); }
.incident-update-status.identified { color: var(--orange); }

.incident-update-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 5px;
}

.incident-update-message {
    margin-top: 5px;
    font-size: 14px;
    color: #4f5660;
}

/* ==================
   FOOTER
   ================== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    font-size: 13px;
    font-weight: 500;
    color: var(--header-bg);
}

.powered-by {
    font-size: 13px;
    color: var(--text-secondary);
}

.powered-by strong {
    color: var(--header-bg);
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--header-bg);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
}

    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 4px;
}

.uptime-bar:hover .uptime-bar-tooltip {
    display: block;
}

.uptime-summary {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ==================
   UPTIME SECTION DIVIDER
   ================== */
.uptime-section {
    margin-top: 30px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.uptime-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.uptime-header>span {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.uptime-link {
    font-size: 12px;
    font-weight: 400;
    color: var(--blue);
}

/* ==================
   PAST INCIDENTS
   ================== */
.incidents-section {
    margin-bottom: 40px;
}

.incidents-list {
    display: flex;
    flex-direction: column;
}

.incident-day {
    padding: 14px 0 4px;
    border-bottom: 1px solid var(--border-light);
}

.incident-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.no-incidents {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 0 10px;
    font-style: italic;
}

/* Incident Cards */
.incident-card {
    padding: 10px 0 12px;
}

.incident-header {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 6px;
}

.incident-status-icon {
    display: none;
}

.incident-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--orange);
}

.incident-title.resolved {
    color: var(--text-dark);
}

.incident-updates {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 0;
}

.incident-update {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.incident-update-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.incident-update-status {
    font-size: 13px;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--text-dark);
}

.incident-update-status.resolved {
    color: var(--green);
}

.incident-update-status.investigating {
    color: var(--yellow);
}

.incident-update-status.identified {
    color: var(--orange);
}

.incident-update-status.monitoring {
    color: var(--blue);
}

.incident-update-status.update {
    color: var(--text-secondary);
}

.incident-update-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.incident-update-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==================
   FOOTER
   ================== */
.footer {
    background-color: transparent;
    border-top: none;
    padding: 14px 0 20px;
    margin-top: auto;
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    font-size: 12px;
    color: var(--blue);
}

.powered-by {
    font-size: 12px;
    color: var(--text-secondary);
}

.powered-by strong {
    color: var(--blue);
    font-weight: 400;
}

/* ==================
   LOADING
   ================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--header-bg);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================
   RESPONSIVE
   ================== */
@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }

    .subscribe-btn {
        font-size: 11px;
        right: 16px;
    }

    .main-content {
        padding: 20px 16px;
    }

    .status-text {
        font-size: 13px;
    }

    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .logo {
        font-size: 22px;
    }

    .logo-icon {
        width: 38px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .subscribe-btn {
        display: none;
    }

    .uptime-bar-container {
        height: 24px;
    }
}

/* ==================
   STATUS INDICATOR DOT
   ================== */
.status-indicator {
    display: none;
}

.component-description {
    display: none;
}

.response-time {
    display: none;
}

/* ==================
   SUBSCRIBE MODAL
   ================== */
.subscribe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.subscribe-modal-content {
    background-color: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: subscribeModalAppear 0.3s ease-out;
}

@keyframes subscribeModalAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subscribe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--white);
}

.subscribe-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.subscribe-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.subscribe-modal-close:hover {
    background-color: var(--body-bg);
    color: var(--text-dark);
}

.subscribe-modal form {
    padding: 24px;
}

.subscribe-form-group {
    margin-bottom: 20px;
}

.subscribe-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.subscribe-form-group input[type="url"] {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.subscribe-form-group input:focus {
    outline: none;
    border-color: var(--header-bg);
    box-shadow: 0 0 0 3px rgba(85, 100, 95, 0.1);
}

.subscribe-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.subscribe-form-error {
    color: var(--red);
    background-color: rgba(247, 71, 71, 0.1);
    border: 1px solid var(--red);
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
}

.subscribe-form-error:empty {
    display: none;
}

.subscribe-modal-actions {
    display: flex;
    gap: 12px;
}

.subscribe-btn-primary,
.subscribe-btn-secondary {
    flex: 1;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font-primary);
}

.subscribe-btn-primary {
    background-color: var(--header-bg);
    color: var(--white);
}

.subscribe-btn-primary:hover:not(:disabled) {
    background-color: #48574f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 100, 95, 0.3);
}

.subscribe-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.subscribe-btn-secondary {
    background-color: var(--gray);
    color: var(--white);
}

.subscribe-btn-secondary:hover {
    background-color: #5d6671;
}