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

.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}

html {
    scrollbar-gutter: stable;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 0;
    color: #161313;
    margin: 0;
}

.page-navbar {
    background: #fffffe;
    padding: 0;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #bababa;
}

.page-navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
    padding-right: 24px;
    padding-bottom: 12px;
    padding-left: 24px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    box-sizing: border-box;
}

.page-navbar .site-title {
    font-size: 1.3rem;
    color: #000001;
    margin: 0;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.page-navbar .site-title:hover {
    color: #292929;
}

.page-navbar .site-title .separator {
    color: #9f9f9f;
    margin: 0 4px;
    font-weight: 400;
}

.page-navbar .site-title .brand-name {
    color: #292929;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
}

.page-navbar .site-title .brand-name:hover {
    color: #000001;
    text-decoration: underline;
}


.container {
    max-width: 1200px;
    margin: 32px auto;
    background: transparent;
    padding-top: 0;
    padding-right: 24px;
    padding-bottom: 0;
    padding-left: 24px;
    box-sizing: border-box;
}

.loading, .error {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #161313;
    background: #fffffe;
    border-radius: 5px;
    box-shadow: 5px 5px 15px rgba(31, 31, 31, 3%);
}

.error {
    color: #161313;
    background: #fffffe;
    border-radius: 5px;
    border: none;
}

.brands-container {
    display: block;
    margin-top: 0;
}

.brand-card {
    display: block;
    background: #fffffe;
    border-radius: 5px;
    padding: 12px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    color: inherit;
    box-shadow: 5px 5px 15px rgba(31, 31, 31, 3%);
}

.brand-card:hover {
    box-shadow: 5px 5px 20px rgba(31, 31, 31, 6%);
    transform: translateY(-1px);
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    color: #292929;
    margin-bottom: 4px;
    text-transform: capitalize;
    line-height: 20px;
}

.brand-count {
    color: #9f9f9f;
    font-size: 11px;
    font-style: italic;
    line-height: 14px;
}

.emails-list {
    margin-top: 0;
}

.email-item {
    display: block;
    background: #fffffe;
    border-radius: 5px;
    padding: 12px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    color: inherit;
    box-shadow: 5px 5px 15px rgba(31, 31, 31, 3%);
}

.email-item:hover {
    box-shadow: 5px 5px 20px rgba(31, 31, 31, 6%);
    transform: translateY(-1px);
}

.email-title {
    font-weight: 700;
    color: #292929;
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.email-title .material-symbols-outlined {
    font-size: 18px;
    color: #9f9f9f;
    flex-shrink: 0;
}

.email-date {
    color: #9f9f9f;
    font-size: 11px;
    font-style: italic;
    line-height: 14px;
}

.back-button {
    background: linear-gradient(180deg, #423939 0%, #161313 49.48%, #121010 100%);
    color: white;
    border: none;
    padding: 15px 32px;
    border-radius: 34px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.84px;
    text-transform: uppercase;
    cursor: pointer;
    margin-bottom: 24px;
    transition: opacity 0.2s ease;
}

.back-button:hover {
    opacity: 0.9;
}

.email-viewer {
    margin-top: 0;
    background: transparent;
}

#email-content {
    background: #fffffe;
    border: none;
    border-radius: 5px;
    padding: 32px;
    max-width: 100%;
    overflow-x: auto;
    box-shadow: 5px 5px 15px rgba(31, 31, 31, 3%);
}

#email-content iframe {
    width: 100%;
    min-height: 600px;
    border: none;
    border-radius: 4px;
    display: block;
}

.email-iframe-container {
    position: relative;
}

.fullscreen-button {
    position: absolute;
    top: 12px;
    right: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #d6d6d6;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    color: #161313;
    box-shadow: 2px 2px 4px rgba(31, 31, 31, 3%);
}

.fullscreen-button .material-symbols-outlined {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.fullscreen-button:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #bababa;
    box-shadow: 2px 2px 8px rgba(31, 31, 31, 6%);
}

.fullscreen-button:active {
    transform: scale(0.95);
}

#email-content.maximized {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 16px;
    background: white;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
    display: flex;
    flex-direction: column;
}

#email-content.maximized > div:first-child {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.email-iframe-container.maximized {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    border: none;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.email-iframe-container.maximized iframe {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .page-navbar .site-title {
        font-size: 1rem;
    }

    .brands-container {
        grid-template-columns: 1fr;
    }
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #292929;
    margin-bottom: 12px;
    line-height: 1.3;
}

.empty-state-message {
    font-size: 1rem;
    color: #9f9f9f;
    line-height: 1.6;
    margin: 0;
}

/* Forwarded emails separator */
.forwarded-separator {
    margin: 32px 0 16px 0;
}

.forwarded-separator hr {
    border: none;
    border-top: 1px solid #d6d6d6;
    margin: 0 0 12px 0;
}

.forwarded-label {
    color: #9f9f9f;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-top: 8px;
}
