:root {
    --brand-red: #c1121f;
    --brand-red-dark: #960f1a;
    --bg-soft: #fff5f5;
    --surface: #ffffff;
    --text-main: #212121;
    --text-muted: #666666;
    --border-light: #ead4d4;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--text-main);
    background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%);
}

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--brand-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
}

.header-center h1 {
    margin: 0;
    font-size: 1.5rem;
}

.random-btn {
    background-color: #fff;
    border: none;
    color: var(--brand-red);
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.random-btn:hover {
    background-color: #ffe8e8;
}

.header-right > a, .header-right > button {
    color: var(--brand-red);
    margin-left: 15px;
    text-decoration: none;
    background-color: #fff;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-block;
}

.header-right a:hover {
    background-color: #ffe8e8;
}

.user-menu-wrapper {
    position: relative;
}

.favorite-btn {
    color: var(--brand-red);
    margin-left: 15px;
    text-decoration: none;
    background-color: #fff;
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    background-color: #ffe8e8;
}

.favorite-btn.active {
    background-color: #ffd6d9;
}

.favorite-btn.active i {
    color: #9f0f1a;
}

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

.user-menu-btn {
    color: var(--brand-red);
    margin-left: 15px;
    text-decoration: none;
    background-color: #fff;
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-menu-btn:hover {
    background-color: #ffe8e8;
}

.user-toast-menu {
    position: absolute;
    top: 45px;
    right: 0;
    width: 290px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 16px 38px rgba(120, 22, 30, 0.2);
    display: none;
    overflow: hidden;
    z-index: 1200;
}

.user-toast-menu.open {
    display: block;
}

.menu-user-block {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: #fff3f3;
    border-bottom: 1px solid var(--border-light);
}

.menu-user-block strong {
    color: var(--text-main);
    font-size: 0.95rem;
}

.menu-user-block span {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 3px;
    word-break: break-all;
}

.menu-item {
    display: block;
    padding: 12px 14px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.96rem;
    border-bottom: 1px solid #f3e2e2;
}

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

.menu-list li {
    margin: 0;
    padding: 0;
}

.user-toast-menu .menu-item {
    margin-left: 0;
    border-radius: 0;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
}

.menu-item:hover {
    background: #fff3f3;
}

.menu-divider {
    display: none;
}

.menu-item-logout {
    color: var(--brand-red);
    font-weight: 600;
    border-bottom: none;
}

.content {
    margin-top: 80px; /* header height + spacing */
    padding: 16px;
    text-align: center;
}

.domain-container h2 {
    font-size: 2rem;
}

.domain-frame {
    width: 100%;
    height: calc(100vh - 90px); /* header + footer height */
    border: none;
    margin: 0;
    padding: 0;
}

.domain-controls {
    margin-top: 20px;
}

/* Header title size */
.header-left h1 {
    font-size: 1.2rem;
}

/* Footer */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background-color: var(--brand-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    font-size: 0.9rem;
}

.fixed-footer a {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-icon-btn,
.footer-actions a {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: transparent;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.footer-icon-btn {
    padding: 0;
}

.fixed-footer a:hover {
    color: #ffe8e8;
}

.footer-icon-btn:hover,
.footer-actions a:hover {
    color: #ffe8e8;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.55);
}

.profile-page {
    max-width: 900px;
    margin: 0 auto 60px auto;
}

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    text-align: left;
    margin-bottom: 18px;
    padding: 18px;
}

.profile-card h2,
.profile-card h3 {
    margin-top: 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 10px;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.btn-secondary {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    color: var(--brand-red);
    border: 1px solid #efb9bc;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #fff2f2;
}

.btn-primary {
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--brand-red);
    color: #fff;
    cursor: pointer;
}

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

.interests-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.interest-option {
    border: 1px solid #e8c3c5;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-message {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fff2f2;
    border: 1px solid #efc0c3;
}

.interests-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.interests-fieldset[disabled] {
    opacity: 0.6;
}

.app-toast {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 1400;
    max-width: min(92vw, 360px);
    background: #1f1f1f;
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.error {
    background: #8f1d1d;
}

.favorites-page {
    max-width: 980px;
    margin: 0 auto 60px auto;
}

.favorites-shell {
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
}

.favorites-hero {
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(90deg, #fff1f1 0%, #ffe4e6 100%);
    border: 1px solid #f2cbcf;
}

.favorites-count {
    background: #ffffff;
    color: var(--brand-red);
    border: 1px solid #e8b7bc;
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
}

.favorites-table-wrap {
    overflow-x: auto;
}

.favorites-input-group .input-group-text {
    border: 1px solid #e2bcbc;
    border-right: 0;
    background: #fff6f6;
    color: #ad2c37;
}

.favorites-input-group .form-control {
    border: 1px solid #e2bcbc;
    border-left: 0;
    box-shadow: none;
}

.favorites-select {
    border: 1px solid #e2bcbc;
    box-shadow: none;
    background: #fff;
}

.empty-state {
    border: 1px dashed #efc8cc;
    border-radius: 14px;
    background: #fff;
}

.empty-state i {
    color: #c14450;
}

.favorites-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.filter-input,
.filter-select {
    border: 1px solid #e2bcbc;
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 0.95rem;
    background: #fff;
}

.filter-input {
    min-width: min(100%, 280px);
}

.favorites-table {
    width: 100%;
    border-collapse: collapse;
}

.favorites-table thead th {
    white-space: nowrap;
    color: #7f3036;
    border-bottom: 2px solid #ebc5c8;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.favorites-table tbody td {
    border-bottom: 1px solid #ecd2d2;
}

.icon-link,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #e7b8b8;
    background: #fff;
    color: var(--brand-red);
    text-decoration: none;
}

.icon-link:hover,
.icon-btn:hover {
    background: #fff1f1;
}

.icon-btn {
    cursor: pointer;
}

.icon-btn.danger {
    color: #9f2020;
}

.icon-btn.danger:hover {
    background: #ffe9e9;
}

.pagination {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.page-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #e7b8b8;
    text-decoration: none;
    color: var(--brand-red);
    background: #fff;
}

.page-link:hover {
    background: #fff1f1;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .fixed-header {
        padding: 0 12px;
    }

    .header-left h1 {
        font-size: 1rem;
    }

    .random-btn {
        padding: 7px 11px;
        font-size: 0.9rem;
    }

    .header-right > a,
    .header-right > button {
        margin-left: 8px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .favorite-btn,
    .user-menu-btn {
        margin-left: 8px;
        padding: 6px 9px;
        font-size: 0.9rem;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .user-toast-menu {
        right: -6px;
        width: min(86vw, 290px);
    }

    .profile-page {
        margin-bottom: 70px;
    }

    .app-toast {
        right: 12px;
        top: 66px;
    }

    .domain-frame {
        height: calc(100vh - 110px);
    }
}
