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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f5f5;
    color: #1e293b;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #060097 0%, #c10fff 100%);
    color: white;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.header {
    background: linear-gradient(135deg, #060097 0%, #c10fff 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-right {
    display: flex;
    gap: 10px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: #ffcd57;
    color: #1e293b;
}

.btn-primary:hover {
    background: #ffd770;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

.main-content {
    display: flex;
    height: calc(100vh - 80px);
}

.email-list {
    width: 400px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

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

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

.email-list-container {
    flex: 1;
    overflow-y: auto;
}

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

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

.email-item.active {
    background: #f0f0ff;
    border-left: 4px solid #060097;
}

.email-item-from {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #1e293b;
}

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

.email-item-date {
    font-size: 12px;
    color: #9ca3af;
}

.email-viewer {
    flex: 1;
    background: white;
    overflow-y: auto;
}

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

.email-content {
    padding: 40px;
    max-width: 800px;
}

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

.email-subject {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1e293b;
}

.email-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.email-meta-row {
    display: flex;
    gap: 10px;
}

.email-meta-label {
    font-weight: 600;
    min-width: 60px;
}

.email-body {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    margin-bottom: 30px;
}

.email-actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.reply-box {
    margin-top: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.reply-box h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.reply-box textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.reply-box .form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
}

.close-modal:hover {
    color: #1e293b;
}

.modal form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

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

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .email-list {
        width: 100%;
        height: 50%;
    }
    
    .email-viewer {
        height: 50%;
    }
    
    .email-content {
        padding: 20px;
    }
}
.email-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #f3f4f6;
    color: #1e293b;
}

.tab-btn.active {
    color: #060097;
    border-bottom: 3px solid #060097;
    background: white;
}

.email-item-to {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #1e293b;
}