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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    height: 100vh;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #1a73e8;
    font-size: 24px;
}

.btn-refresh {
    padding: 8px 16px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-refresh:hover {
    background: #1557b0;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: white;
    padding: 20px;
    border-right: 1px solid #e0e0e0;
}

.btn-compose {
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: bold;
}

.btn-compose:hover {
    background: #1557b0;
}

.folders {
    margin-top: 20px;
}

.folder {
    padding: 10px;
    margin: 5px 0;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.folder:hover {
    background: #f0f2f5;
}

.folder.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: bold;
}

.count {
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.email-list {
    width: 400px;
    background: white;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}

.list-container {
    padding: 10px;
}

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

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

.email-item.unread {
    background: #f0f7ff;
    font-weight: bold;
}

.email-from {
    font-weight: 600;
    margin-bottom: 5px;
}

.email-subject {
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

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

.email-view {
    flex: 1;
    background: white;
    overflow-y: auto;
    padding: 30px;
}

.view-container {
    max-width: 800px;
    margin: 0 auto;
}

.placeholder {
    text-align: center;
    color: #999;
    padding: 50px;
}

.email-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.email-header h3 {
    margin: 10px 0;
    color: #333;
}

.email-header p {
    color: #666;
    margin: 5px 0;
}

.email-body {
    line-height: 1.6;
    color: #333;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 50px auto;
    width: 600px;
    max-width: 90%;
    border-radius: 10px;
    padding: 30px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

#composeForm input,
#composeForm textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.btn-send {
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.btn-send:hover {
    background: #1557b0;
}
.pagination {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.page-btn {
    padding: 8px 16px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.page-btn:hover {
    background: #1557b0;
}

.page-info {
    color: #666;
}

.attachments-area {
    margin: 15px 0;
}

.btn-attach {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-attach:hover {
    background: #e0e0e0;
}

#attachments {
    display: none;
}

.attachment-list {
    margin-top: 10px;
}

.attachment-item {
    background: #f8f9fa;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-attachment {
    cursor: pointer;
    color: red;
    margin-left: 10px;
}

.attachments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.attachments-section ul {
    list-style: none;
    padding-left: 0;
}

.attachments-section li {
    padding: 5px 0;
}

.header-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-logout {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-logout:hover {
    background: #c82333;
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #1a73e8;
    border-bottom: 2px solid #1a73e8;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.auth-form button {
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
}

.auth-form button:hover {
    background: #1557b0;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}