:root {
    --primary-background: #FFFFFF;
    --cool-blue: #294a7f;
    --light-grey: #f0f2f5;
    --dark-grey: #939598;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --error-bg: #f8d7da;
    --info-bg: #e7f3ff;
    --success-bg: #d4edda;
    --error-text: #721c24;
    --info-text: #0c5460;
    --success-text: #155724;
}

/* I. General Layout & Theme */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--primary-background);
    color: #1c1e21;
    margin: 0;
    /*display: flex;*/
    justify-content: center;
    min-height: 100vh;
}

.main-container {
    width: 90%;
    max-width: 1400px;
    margin: 20px auto;
    background-color: var(--primary-background);
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--light-grey);
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

footer {
    width: 100%;
    background-color: var(--primary-background);
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    border-top: 1px solid var(--light-grey);
}

footer a {
    color: var(--cool-blue);
    margin: 0 15px;
    text-decoration: none;
}

/* II. Element Styling & Interactivity */
button, .button {
    background-color: var(--light-grey);
    color: #000;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

button:hover, .button:hover {
    background-color: #e2e6ea;
    color: #000;
}
button:active, .button:active {
    background-color: #d4dae0;
}

button.primary, .button.primary {
    background-color: var(--cool-blue);
    color: #fff;
}
button.primary:hover, .button.primary:hover {
    background-color: #1e3a66;
}

button.success, .button.success {
    background-color: var(--success-bg);
    color: var(--success-text);
    transition-duration: 0.5s;
}

.message {
    padding: 1rem;
    border: 1px solid transparent;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.message.error {
    background-color: var(--error-bg);
    color: var(--error-text);
}

.message.info {
    background-color: var(--info-bg);
    color: var(--info-text);
}

.message.success {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.inactive {
    background-color: #fafafa !important;
    color: #999 !important;
    opacity: 0.7;
}
.inactive * {
    color: #999 !important;
}




/* III. Admin Interface (Wide-Screen Specific) */


.tabs {
    display: flex;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    width: 100%;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-grey);
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-link:hover {
    color: var(--cool-blue);
}

.tab-link.active {
    color: var(--cool-blue);
    border-bottom: 2px solid var(--cool-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#admin-content {
    background-color: transparent;
    padding: 0;
    box-shadow: none;
}

input, textarea {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

.link-admin, .campaign-admin, .user-admin-row {
    display: grid;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border-color);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
}
.user-admin-row.inactive {
    background-color: var(--light-grey);
}
.user-admin-row.inactive * {
    color: var(--dark-grey) !important;
}

.user-admin-header {
    display: grid;
    padding: 10px;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
    align-items: center;
}

.user-admin-header, .user-admin-row {
    grid-template-columns: 2fr 1.5fr 1fr 1.5fr 1.5fr;
}

.user-col-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.user-col-actions button {
    white-space: nowrap;
}

.social-link-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.social-link-row select {
    width: 150px;
    flex-shrink: 0;
}
.social-link-row input {
    flex-grow: 1;
}
.social-link-row button {
    flex-shrink: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
.header-logo {
    height: 128px;
}
.admin-page .main-container {
    width: 90% !important;
    max-width: 1400px !important;
    margin: 20px auto !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.admin-page .header-left {
    gap: 12px;
}

.admin-page .header-logo {
    /* reduce admin header logo by 50% (was 128px) */
    height: 64px !important;
}
#admin-title {
    margin: 0;
    font-size: 1.5rem;
}
#preview-link svg {
    vertical-align: middle;
    color: var(--cool-blue);
}

/* Homepage Styles */
.homepage-container {
    text-align: center;
    padding: 40px 20px;
}

.homepage-header h1 {
    font-size: 2.5rem;
    color: var(--cool-blue);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.homepage-header h2 {
    font-size: 1.5rem;
    color: var(--dark-grey);
    font-weight: normal;
    margin-bottom: 2rem;
}

.features {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.feature {
    background-color: var(--primary-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    width: 30%;
    min-width: 250px;
    text-align: left;
}
.feature h3 {
    color: var(--cool-blue);
}

.how-it-works {
    margin: 40px auto;
    max-width: 800px;
    text-align: left;
}
.how-it-works h3 {
    color: var(--cool-blue);
}

.cta {
    margin-top: 40px;
}
.cta h3 {
    color: var(--cool-blue);
}

.beta-status {
    margin-top: 40px;
    color: var(--dark-grey);
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    text-align: center;
    margin: 40px auto;
}
.login-container header h1 {
    color: var(--cool-blue);
}

.name-prompt {
    background-color: var(--info-bg);
    color: var(--info-text);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.theme-setting {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.theme-setting label {
    flex-shrink: 0;
}
.theme-setting input[type="color"] {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    vertical-align: middle;
}
.theme-setting input[type="text"] {
    width: 100px;
}

.link-admin {
    grid-template-columns: 40px 80px 1fr 2fr auto;
}
.link-admin-header {
    display: grid;
    grid-template-columns: 40px 80px 1fr 2fr auto;
    gap: 10px;
    padding: 10px;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}
.link-admin-header div {
    text-align: center;
}
.link-admin-header div:nth-child(3),
.link-admin-header div:nth-child(4),
.link-admin-header div:nth-child(5) {
    text-align: left;
}




.campaign-link-row {
    display: grid;
    grid-template-columns: 50px 60px 1fr;
    gap: 10px;
    align-items: center;
    padding: 5px;
}

.campaign-link-row .link-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.campaign-link-row .link-info img {
    width: 48px;
    height: 48px;
}

.campaign-links-edit .link-order {
    width: 40px;
}
.campaign-links-edit .link {
    width: auto;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 17px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 13px;
    width: 13px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--cool-blue);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--cool-blue);
}

input:checked + .slider:before {
    -webkit-transform: translateX(13px);
    -ms-transform: translateX(13px);
    transform: translateX(13px);
}

.slider.round {
    border-radius: 17px;
}

.slider.round:before {
    border-radius: 50%;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    z-index: 1000;
    opacity: 0.9;
    transition: opacity 0.5s ease-in-out;
}

.notification-success {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.notification-error {
    background-color: var(--error-bg);
    color: var(--error-text);
}

.tenant-filter-container {
    margin-bottom: 20px;
}

.tenant-filter-container label {
    margin-right: 10px;
}

.tenant-filter-container select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}