:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --background-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ddd;
    --unread-color: #e3f2fd;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    margin: 0;
    color: var(--secondary-color);
}

h1 i {
    margin-right: 10px;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--secondary-color);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.search-box {
    display: flex;
    align-items: center;
}

#search-input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    width: 200px;
}

#search-btn {
    border-radius: 0 4px 4px 0;
}

.email-list-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.email-list-header {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr;
    padding: 15px;
    background-color: var(--secondary-color);
    color: white;
    font-weight: bold;
}

.email-list {
    max-height: 600px;
    overflow-y: auto;
}

.email-item {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.email-item:hover {
    background-color: #f0f0f0;
}

.email-item.unread {
    background-color: var(--unread-color);
    font-weight: bold;
}

.email-item .from {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item .subject {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item .date {
    text-align: right;
    color: #666;
    font-size: 0.9em;
}

.loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

#page-info {
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .email-list-header, .email-item {
        grid-template-columns: 1fr 2fr;
    }
    
    .email-list-header .header-date, 
    .email-item .date {
        display: none;
    }
}