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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.error {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
}

/* Login Screen */
.screen {
    width: 100%;
    height: 100vh;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
}

#login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

#login-form button {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#login-form button:hover {
    background: #2980b9;
}

/* Header */
header {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
}

.header-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

/* Main Container */
.main-container {
    display: grid;
    grid-template-columns: 250px 400px 1fr;
    height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    padding: 12px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-item:hover {
    background: #f5f5f5;
}

.nav-item.active {
    background: #e3f2fd;
    color: #2196f3;
}

/* Email List */
.email-list {
    background: white;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}

.list-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.list-header h2 {
    font-size: 20px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #f5f5f5;
}

.email-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.email-item:hover {
    background: #f9f9f9;
}

.email-item.unread {
    background: #f5f9ff;
}

.email-item.selected {
    background: #e3f2fd;
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.email-from {
    font-weight: 600;
    color: #333;
}

.email-date {
    font-size: 12px;
    color: #999;
}

.email-subject {
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.email-preview {
    font-size: 14px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Email Detail */
.email-detail {
    background: white;
    padding: 30px;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #999;
    font-size: 18px;
}

.email-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.email-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.email-subject-detail {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
}

.email-meta {
    font-size: 14px;
    color: #666;
}

.email-meta div {
    margin-bottom: 5px;
}

.email-body {
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Buttons */
.btn-secondary {
    padding: 8px 16px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.modal-header h2 {
    font-size: 22px;
}

#compose-form {
    padding: 20px;
}

#compose-form input,
#compose-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}

#compose-form textarea {
    resize: vertical;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}