/* Portal styles — designed to complement MkDocs Material's default theme */

:root {
    --cid-primary: #3f51b5;
    --cid-primary-dark: #303f9f;
    --cid-accent: #536dfe;
    --cid-bg: #fafafa;
    --cid-surface: #ffffff;
    --cid-text: #212121;
    --cid-text-secondary: #757575;
    --cid-border: #e0e0e0;
    --cid-error: #d32f2f;
    --cid-success: #388e3c;
    --cid-warning: #f57c00;
    --cid-radius: 8px;
    --cid-max-width: 960px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--cid-text);
    background: var(--cid-bg);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Header */
.portal-header {
    background: var(--cid-primary);
    color: #fff;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header a {
    color: #fff;
    text-decoration: none;
}

.portal-header__title {
    font-size: 1.25rem;
    font-weight: 600;
}

.portal-header__nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.portal-header__nav a {
    font-size: 0.875rem;
    opacity: 0.9;
}

.portal-header__nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Main content container */
.portal-main {
    max-width: var(--cid-max-width);
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Cards */
.card {
    background: var(--cid-surface);
    border: 1px solid var(--cid-border);
    border-radius: var(--cid-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--cid-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, box-shadow 0.15s;
    line-height: 1.5;
}

.btn-primary {
    background: var(--cid-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--cid-primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--cid-primary);
    border: 1px solid var(--cid-primary);
}

.btn-secondary:hover {
    background: rgba(63, 81, 181, 0.08);
}

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

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--cid-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cid-border);
    border-radius: var(--cid-radius);
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    background: var(--cid-surface);
    color: var(--cid-text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--cid-primary);
    box-shadow: 0 0 0 2px rgba(63, 81, 181, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--cid-text-secondary);
    margin-top: 0.25rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--cid-radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fdecea;
    color: var(--cid-error);
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #e8f5e9;
    color: var(--cid-success);
    border: 1px solid #c8e6c9;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-open {
    background: #fff3e0;
    color: var(--cid-warning);
}

.badge-answered {
    background: #e8f5e9;
    color: var(--cid-success);
}

.badge-closed {
    background: #f5f5f5;
    color: var(--cid-text-secondary);
}

/* Request list */
.request-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.request-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--cid-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

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

.request-item__info {
    flex: 1;
}

.request-item__subject {
    font-weight: 500;
    color: var(--cid-primary);
    text-decoration: none;
}

.request-item__subject:hover {
    text-decoration: underline;
}

.request-item__meta {
    font-size: 0.8125rem;
    color: var(--cid-text-secondary);
    margin-top: 0.25rem;
}

/* Reply thread */
.reply {
    padding: 0.75rem 1rem;
    border-radius: var(--cid-radius);
    margin-bottom: 0.75rem;
}

.reply-customer {
    background: #e3f2fd;
    margin-right: 3rem;
}

.reply-staff {
    background: #f3e5f5;
    margin-left: 3rem;
}

.reply__meta {
    font-size: 0.75rem;
    color: var(--cid-text-secondary);
    margin-bottom: 0.25rem;
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--cid-text-secondary);
}

/* Sign-in page */
.signin-container {
    text-align: center;
    max-width: 480px;
    margin: 4rem auto;
}

.signin-container h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.signin-container p {
    color: var(--cid-text-secondary);
    margin-bottom: 2rem;
}

/* Contact fallback */
.contact-fallback {
    background: #fff8e1;
    border: 1px solid #fff0b3;
    border-radius: var(--cid-radius);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.contact-fallback a {
    color: var(--cid-primary);
    font-weight: 500;
}

/* Footer */
.portal-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    font-size: 0.8125rem;
    color: var(--cid-text-secondary);
    border-top: 1px solid var(--cid-border);
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 600px) {
    .portal-header {
        padding: 0 1rem;
    }

    .portal-main {
        padding: 0 1rem;
    }

    .request-item {
        flex-direction: column;
    }

    .reply-staff {
        margin-left: 1rem;
    }

    .reply-customer {
        margin-right: 1rem;
    }
}
