:root {
    --primary-color: #2563eb;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --ad-bg-color: #e5e7eb;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    flex: 1;
}

/* Ads */
.ad-banner {
    width: 100%;
    height: 90px;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    border: 2px dashed #9ca3af;
    margin-top: auto;
}

.sidebar-ad {
    width: 300px;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    border: 2px dashed #9ca3af;
    align-self: flex-start;
    height: 600px;
}

.ad-placeholder {
    color: #4b5563;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Header */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--white);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.email-box {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 700px;
    margin: 0 2rem;
    align-items: center;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: #f9fafb;
    padding: 0 0.75rem;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

#email-address {
    flex: 1;
    padding: 0.75rem 0;
    border: none;
    font-family: monospace;
    font-size: 1.1rem;
    text-align: right;
    background-color: transparent;
    color: var(--text-color);
    min-width: 50px;
}

#email-address:focus {
    outline: none;
}

.domain {
    font-family: monospace;
    font-size: 1.1rem;
    color: #6b7280;
    user-select: none;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    background-color: var(--primary-color);
    color: var(--white);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    white-space: nowrap;
}

button:hover {
    background-color: #1d4ed8;
}

.timer {
    font-size: 0.875rem;
    color: #6b7280;
    min-width: 120px;
    text-align: right;
}

/* Content Area */
.content-area {
    display: flex;
    gap: 1rem;
    min-height: 800px;
}

/* Email List */
.email-list-container {
    flex: 1;
    background-color: var(--white);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 0;
}

.list-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.email-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.1s;
}

.email-item:hover {
    background-color: #f9fafb;
}

.email-item.active {
    background-color: #eff6ff;
    border-left: 4px solid var(--primary-color);
}

.email-item .sender {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item .subject {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item .time {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Empty State */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 2rem;
    text-align: center;
}

/* Email Detail */
.email-detail-container {
    flex: 1;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.detail-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #f9fafb;
}

.back-btn {
    background-color: transparent;
    color: var(--primary-color);
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-align: left;
}

.back-btn:hover {
    background-color: transparent;
    text-decoration: underline;
}

.detail-title-row h2 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.detail-meta {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    gap: 1rem;
}

.detail-body-wrapper {
    flex: 1;
    padding: 1rem;
    background-color: #fff;
    overflow: hidden;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar-ad {
        display: none;
    }
}

@media (max-width: 768px) {
    .content-area {
        flex-direction: column;
        min-height: auto;
    }

    .email-list-container {
        width: 100%;
        height: 300px;
    }

    .main-header {
        flex-direction: column;
        gap: 1rem;
    }

    .email-box {
        width: 100%;
        margin: 0;
        flex-wrap: wrap;
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
    color: #333;
}

.separator {
    color: #ccc;
}

.copyright {
    font-size: 0.8rem;
    color: #999;
}