:root {
    --bg-color: #0d0f14;
    --text-primary: #f0f4f8;
    --text-secondary: #9aa8b8;

    /* Gradients & Accents */
    --accent-red: rgba(255, 65, 84, 0.8);
    --accent-purple: rgba(144, 85, 255, 0.8);
    --accent-blue: rgba(45, 140, 255, 0.8);
    --accent-solid: #ff3355;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* --- Decorative Glowing Orbs --- */
.glow-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: float 20s ease-in-out infinite alternate;
}

.orb-1 {
    top: -200px;
    left: -200px;
    background: var(--accent-red);
}

.orb-2 {
    bottom: -200px;
    right: -200px;
    background: var(--accent-purple);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 60%;
    width: 400px;
    height: 400px;
    background: var(--accent-blue);
    animation-delay: -10s;
    opacity: 0.2;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-50px, 50px) scale(1.1);
    }

    100% {
        transform: translate(50px, -50px) scale(0.9);
    }
}

/* --- Layout --- */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* --- Glassmorphism Panels --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* --- Header --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* --- Buttons --- */
.btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-solid) 0%, #aa1133 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 51, 85, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 51, 85, 0.5);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Typography --- */
h2 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    line-height: 1.6;
}

.text-muted {
    color: var(--text-secondary);
}

/* --- Views --- */
.content-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.view-state {
    width: 100%;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.hero {
    text-align: center;
    margin-top: 4rem;
    max-width: 600px;
    margin-inline: auto;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* --- Profile Card --- */
.profile-card {
    padding: 2.5rem;
    width: 100%;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}

.avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
}

.user-details h2 {
    margin-bottom: 0.2rem;
    font-size: 1.8rem;
}

/* --- Toggle Switch --- */
.subscription-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 34px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--glass-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

input:checked+.slider {
    background-color: var(--accent-solid);
    border-color: var(--accent-solid);
}

input:checked+.slider:before {
    transform: translateX(30px);
}

input:disabled+.slider {
    cursor: not-allowed;
    opacity: 0.5;
}

/* --- Loader --- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-solid);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem auto;
}

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

.status-message {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    text-align: right;
    height: 1.2rem;
    color: var(--accent-solid);
}

/* --- Preview Modal / Email Template ported styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: #ffffff;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.outer-table {
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #000;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

.summary-item {
    padding-bottom: 25px;
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 25px;
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.high-priority {
    background-color: #fcfcfc;
    border-left: 3px solid #c53030;
    padding-left: 15px;
}

.category-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: #ffffff;
    background-color: #2c5282;
    padding: 2px 6px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 8px;
}

.source-link {
    font-size: 11px;
    color: #718096;
    text-decoration: none;
    margin-left: 10px;
}

.source-link:hover {
    text-decoration: underline;
    color: #2c5282;
}

.bullet-list {
    margin: 8px 0 0 0;
    padding: 0 0 0 15px;
    list-style-type: none;
}

.bullet-item {
    position: relative;
    font-size: 15px;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 6px;
}

.bullet-item:before {
    content: "•";
    position: absolute;
    left: -15px;
    color: #718096;
}

.footer {
    background-color: #f9f9f9;
    padding: 15px 30px;
    text-align: center;
    font-size: 11px;
    color: #888888;
    border-top: 1px solid #eeeeee;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}